aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_misc.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-06-30 09:57:27 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-06-30 09:57:27 +0100
commit7d03c1bec2460121d3b07c76e98d1eb3bdba7802 (patch)
tree069f2ae4e6a6c34a14aff2bc8e06b22bbe316f63 /tools/libxc/xc_misc.c
parentb4e6f01f78e168f498388a5e03ad8b00001e0c3e (diff)
downloadxen-7d03c1bec2460121d3b07c76e98d1eb3bdba7802.tar.gz
xen-7d03c1bec2460121d3b07c76e98d1eb3bdba7802.tar.bz2
xen-7d03c1bec2460121d3b07c76e98d1eb3bdba7802.zip
stubdom: add live migration support by having ioemu just notify the
hypervisor about memory changes. The impact on disk performance is typically making it from 71.5MBps down to 70.5Mbps during the live migration. The impact on network performance is actually even hard to measure. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Diffstat (limited to 'tools/libxc/xc_misc.c')
-rw-r--r--tools/libxc/xc_misc.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index c68461a496..0fe5272eab 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -267,6 +267,34 @@ int xc_hvm_track_dirty_vram(
return rc;
}
+int xc_hvm_modified_memory(
+ int xc_handle, domid_t dom, uint64_t first_pfn, uint64_t nr)
+{
+ DECLARE_HYPERCALL;
+ struct xen_hvm_modified_memory arg;
+ int rc;
+
+ hypercall.op = __HYPERVISOR_hvm_op;
+ hypercall.arg[0] = HVMOP_modified_memory;
+ hypercall.arg[1] = (unsigned long)&arg;
+
+ arg.domid = dom;
+ arg.first_pfn = first_pfn;
+ arg.nr = nr;
+
+ if ( (rc = lock_pages(&arg, sizeof(arg))) != 0 )
+ {
+ PERROR("Could not lock memory");
+ return rc;
+ }
+
+ rc = do_xen_hypercall(xc_handle, &hypercall);
+
+ unlock_pages(&arg, sizeof(arg));
+
+ return rc;
+}
+
void *xc_map_foreign_pages(int xc_handle, uint32_t dom, int prot,
const xen_pfn_t *arr, int num)
{