aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xenguest.h
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2012-05-11 17:46:15 +0100
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2012-05-11 17:46:15 +0100
commit960371fa2c36814d148968f397b59c1d53590527 (patch)
tree5dd34b75e66c5bfa2967ba118f94422fdf2119b3 /tools/libxc/xenguest.h
parent5b81bb4955500c781d90177e012404fc6177ccad (diff)
downloadxen-960371fa2c36814d148968f397b59c1d53590527.tar.gz
xen-960371fa2c36814d148968f397b59c1d53590527.tar.bz2
xen-960371fa2c36814d148968f397b59c1d53590527.zip
libxc: introduce XC_SAVE_ID_TOOLSTACK
Introduce a new save_id to save/restore toolstack specific extra information. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
Diffstat (limited to 'tools/libxc/xenguest.h')
-rw-r--r--tools/libxc/xenguest.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/tools/libxc/xenguest.h b/tools/libxc/xenguest.h
index 8d885d3133..6435f659af 100644
--- a/tools/libxc/xenguest.h
+++ b/tools/libxc/xenguest.h
@@ -44,6 +44,14 @@ struct save_callbacks {
/* Enable qemu-dm logging dirty pages to xen */
int (*switch_qemu_logdirty)(int domid, unsigned enable, void *data); /* HVM only */
+ /* Save toolstack specific data
+ * @param buf the buffer with the data to be saved
+ * @param len the length of the buffer
+ * The callee allocates the buffer, the caller frees it (buffer must
+ * be free'able).
+ */
+ int (*toolstack_save)(uint32_t domid, uint8_t **buf, uint32_t *len, void *data);
+
/* to be provided as the last argument to each callback function */
void* data;
};
@@ -62,6 +70,16 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
unsigned long vm_generationid_addr);
+/* callbacks provided by xc_domain_restore */
+struct restore_callbacks {
+ /* callback to restore toolstack specific data */
+ int (*toolstack_restore)(uint32_t domid, uint8_t *buf,
+ uint32_t size, void* data);
+
+ /* to be provided as the last argument to each callback function */
+ void* data;
+};
+
/**
* This function will restore a saved domain.
*
@@ -75,6 +93,8 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
* @parm superpages non-zero to allocate guest memory with superpages
* @parm no_incr_generationid non-zero if generation id is NOT to be incremented
* @parm vm_generationid_addr returned with the address of the generation id buffer
+ * @parm callbacks non-NULL to receive a callback to restore toolstack
+ * specific data
* @return 0 on success, -1 on failure
*/
int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
@@ -83,7 +103,8 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
unsigned long *console_mfn, domid_t console_domid,
unsigned int hvm, unsigned int pae, int superpages,
int no_incr_generationid,
- unsigned long *vm_generationid_addr);
+ unsigned long *vm_generationid_addr,
+ struct restore_callbacks *callbacks);
/**
* xc_domain_restore writes a file to disk that contains the device
* model saved state.