aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_domain.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-02-05 12:17:08 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-02-05 12:17:08 +0000
commit2c3072a583d7d57ba0372f3b89f4f20a59693c83 (patch)
treef3c35f7b6b2f19d744bca59933601754773ffd52 /tools/libxc/xc_domain.c
parent0c8eb5a51abb58eb7076b92d82b63f49ea99ed3e (diff)
downloadxen-2c3072a583d7d57ba0372f3b89f4f20a59693c83.tar.gz
xen-2c3072a583d7d57ba0372f3b89f4f20a59693c83.tar.bz2
xen-2c3072a583d7d57ba0372f3b89f4f20a59693c83.zip
libxc support for the new partial-HVM-save domctl.
This includes making the pagetable walker in xc_pagetab.c behave correctly for 32-bit and 64-bit HVM guests. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Diffstat (limited to 'tools/libxc/xc_domain.c')
-rw-r--r--tools/libxc/xc_domain.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index a5f59e6f6a..5bfb34f95a 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -271,6 +271,38 @@ int xc_domain_hvm_getcontext(int xc_handle,
return (ret < 0 ? -1 : domctl.u.hvmcontext.size);
}
+/* Get just one element of the HVM guest context.
+ * size must be >= HVM_SAVE_LENGTH(type) */
+int xc_domain_hvm_getcontext_partial(int xc_handle,
+ uint32_t domid,
+ uint16_t typecode,
+ uint16_t instance,
+ void *ctxt_buf,
+ uint32_t size)
+{
+ int ret;
+ DECLARE_DOMCTL;
+
+ if ( !ctxt_buf )
+ return -EINVAL;
+
+ domctl.cmd = XEN_DOMCTL_gethvmcontext_partial;
+ domctl.domain = (domid_t) domid;
+ domctl.u.hvmcontext_partial.type = typecode;
+ domctl.u.hvmcontext_partial.instance = instance;
+ set_xen_guest_handle(domctl.u.hvmcontext_partial.buffer, ctxt_buf);
+
+ if ( (ret = lock_pages(ctxt_buf, size)) != 0 )
+ return ret;
+
+ ret = do_domctl(xc_handle, &domctl);
+
+ if ( ctxt_buf )
+ unlock_pages(ctxt_buf, size);
+
+ return ret ? -1 : 0;
+}
+
/* set info to hvm guest for restore */
int xc_domain_hvm_setcontext(int xc_handle,
uint32_t domid,