Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2
xen
24328-Tools_Libxc_wrappers_to_automatically_fil...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 24328-Tools_Libxc_wrappers_to_automatically_fill_in_page_oud_page_contents_on_prepare.patch of Package xen
changeset: 24328:8ad47b48047d user: Andres Lagar-Cavilla <andres@lagarcavilla.org> date: Thu Dec 01 18:14:24 2011 +0000 files: tools/libxc/xc_mem_event.c tools/libxc/xc_mem_paging.c tools/libxc/xenctrl.h description: Tools: Libxc wrappers to automatically fill in page oud page contents on prepare Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Tim Deegan <tim@xen.org> --- tools/libxc/xc_mem_event.c | 4 ++-- tools/libxc/xc_mem_paging.c | 23 +++++++++++++++++++++++ tools/libxc/xenctrl.h | 2 ++ 3 files changed, 27 insertions(+), 2 deletions(-) Index: xen-4.1.2-testing/tools/libxc/xc_mem_event.c =================================================================== --- xen-4.1.2-testing.orig/tools/libxc/xc_mem_event.c +++ xen-4.1.2-testing/tools/libxc/xc_mem_event.c @@ -24,7 +24,7 @@ #include "xc_private.h" int xc_mem_event_control(xc_interface *xch, domid_t domain_id, unsigned int op, - unsigned int mode, void *shared_page, + unsigned int mode, void *page, void *ring_page, unsigned long gfn) { DECLARE_DOMCTL; @@ -34,7 +34,7 @@ int xc_mem_event_control(xc_interface *x domctl.u.mem_event_op.op = op; domctl.u.mem_event_op.mode = mode; - domctl.u.mem_event_op.shared_addr = (unsigned long)shared_page; + domctl.u.mem_event_op.u.shared_addr = (unsigned long)page; domctl.u.mem_event_op.ring_addr = (unsigned long)ring_page; domctl.u.mem_event_op.gfn = gfn; 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 @@ -65,6 +65,29 @@ int xc_mem_paging_prep(xc_interface *xch NULL, NULL, gfn); } +int xc_mem_paging_load(xc_interface *xch, domid_t domain_id, + unsigned long gfn, void *buffer) +{ + int rc; + + if ( !buffer ) + return -EINVAL; + + if ( ((unsigned long) buffer) & (XC_PAGE_SIZE - 1) ) + return -EINVAL; + + if ( mlock(buffer, XC_PAGE_SIZE) ) + return -errno; + + 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); + return rc; +} + int xc_mem_paging_resume(xc_interface *xch, domid_t domain_id, unsigned long gfn) { return xc_mem_event_control(xch, domain_id, Index: xen-4.1.2-testing/tools/libxc/xenctrl.h =================================================================== --- xen-4.1.2-testing.orig/tools/libxc/xenctrl.h +++ xen-4.1.2-testing/tools/libxc/xenctrl.h @@ -1742,6 +1742,8 @@ int xc_mem_paging_nominate(xc_interface unsigned long gfn); int xc_mem_paging_evict(xc_interface *xch, domid_t domain_id, unsigned long gfn); int xc_mem_paging_prep(xc_interface *xch, domid_t domain_id, unsigned long gfn); +int xc_mem_paging_load(xc_interface *xch, domid_t domain_id, + unsigned long gfn, void *buffer); int xc_mem_paging_resume(xc_interface *xch, domid_t domain_id, unsigned long gfn);
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