aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_domain_save.c
diff options
context:
space:
mode:
authorPaul Durrant <paul.durrant@citrix.com>2011-12-16 14:54:14 +0000
committerPaul Durrant <paul.durrant@citrix.com>2011-12-16 14:54:14 +0000
commit8f76fc6c983e3bf7c8c32fae2c7264f718e2b467 (patch)
treea279f798e76580f86bffe3f632a0eb276859665d /tools/libxc/xc_domain_save.c
parentbe9b274df12d03fe2366fdbb58a37f537c3d2ff1 (diff)
downloadxen-8f76fc6c983e3bf7c8c32fae2c7264f718e2b467.tar.gz
xen-8f76fc6c983e3bf7c8c32fae2c7264f718e2b467.tar.bz2
xen-8f76fc6c983e3bf7c8c32fae2c7264f718e2b467.zip
tools: VM generation ID save/restore and migrate.
Add code to track the address of the VM generation ID buffer across a save/restore or migrate, and increment it as necessary. The address of the buffer is written into xenstore by hvmloader at boot time. It must be read from xenstore by the caller of xc_domain_save() and then written back again by the caller of xc_domain_restore(). Note that the changes to xc_save.c and xc_restore.c are merely sufficient for them to build. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
Diffstat (limited to 'tools/libxc/xc_domain_save.c')
-rw-r--r--tools/libxc/xc_domain_save.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
index a6bb89475f..f473dd7c5c 100644
--- a/tools/libxc/xc_domain_save.c
+++ b/tools/libxc/xc_domain_save.c
@@ -804,7 +804,8 @@ static int save_tsc_info(xc_interface *xch, uint32_t dom, int io_fd)
int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
uint32_t max_factor, uint32_t flags,
- struct save_callbacks* callbacks, int hvm)
+ struct save_callbacks* callbacks, int hvm,
+ unsigned long vm_generationid_addr)
{
xc_dominfo_t info;
DECLARE_DOMCTL;
@@ -1616,6 +1617,16 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
uint64_t data;
} chunk = { 0, };
+ chunk.id = XC_SAVE_ID_HVM_GENERATION_ID_ADDR;
+ chunk.data = vm_generationid_addr;
+
+ if ( (chunk.data != 0) &&
+ wrexact(io_fd, &chunk, sizeof(chunk)) )
+ {
+ PERROR("Error when writing the generation id buffer location for guest");
+ goto out;
+ }
+
chunk.id = XC_SAVE_ID_HVM_IDENT_PT;
chunk.data = 0;
xc_get_hvm_param(xch, dom, HVM_PARAM_IDENT_PT,