Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:lafenghu
xen
24566-tools-libxc_fix_error_handling_in_xc_mem_...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 24566-tools-libxc_fix_error_handling_in_xc_mem_paging_load.patch of Package xen
changeset: 24566:d5b706214616 user: Olaf Hering <olaf@aepfle.de> date: Thu Jan 26 11:04:59 2012 +0000 files: tools/libxc/xc_mem_paging.c description: tools/libxc: fix error handling in xc_mem_paging_load xc_mem_paging_load() does not pass errors in errno and the actual errno from xc_mem_event_control() is overwritten by munlock(). xenpaging_populate_page() needs to check errno, but with the switch to xc_mem_paging_load() it could not receive ENOMEM anymore. Update xc_mem_paging_load() to return -1 and preserve errno during munlock(). Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Committed-by: Keir Fraser <keir@xen.org> --- tools/libxc/xc_mem_paging.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) Index: xen-4.1.2-testing/tools/libxc/xc_mem_paging.c =================================================================== --- xen-4.1.2-testing.orig/tools/libxc/xc_mem_paging.c +++ xen-4.1.2-testing/tools/libxc/xc_mem_paging.c @@ -68,23 +68,28 @@ int xc_mem_paging_prep(xc_interface *xch int xc_mem_paging_load(xc_interface *xch, domid_t domain_id, unsigned long gfn, void *buffer) { - int rc; + int rc, old_errno; + + errno = -EINVAL; if ( !buffer ) - return -EINVAL; + return -1; if ( ((unsigned long) buffer) & (XC_PAGE_SIZE - 1) ) - return -EINVAL; + return -1; if ( mlock(buffer, XC_PAGE_SIZE) ) - return -errno; + return -1; rc = xc_mem_event_control(xch, domain_id, XEN_DOMCTL_MEM_EVENT_OP_PAGING_PREP, XEN_DOMCTL_MEM_EVENT_OP_PAGING, buffer, NULL, gfn); - (void)munlock(buffer, XC_PAGE_SIZE); + old_errno = errno; + munlock(buffer, XC_PAGE_SIZE); + errno = old_errno; + return rc; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor