diff options
author | Paul Durrant <paul.durrant@citrix.com> | 2011-12-16 14:54:14 +0000 |
---|---|---|
committer | Paul Durrant <paul.durrant@citrix.com> | 2011-12-16 14:54:14 +0000 |
commit | 8f76fc6c983e3bf7c8c32fae2c7264f718e2b467 (patch) | |
tree | a279f798e76580f86bffe3f632a0eb276859665d /tools/python/xen | |
parent | be9b274df12d03fe2366fdbb58a37f537c3d2ff1 (diff) | |
download | xen-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/python/xen')
-rw-r--r-- | tools/python/xen/lowlevel/checkpoint/libcheckpoint.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c b/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c index aefc1cb31b..0fc433fcf9 100644 --- a/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c +++ b/tools/python/xen/lowlevel/checkpoint/libcheckpoint.c @@ -175,6 +175,7 @@ int checkpoint_start(checkpoint_state* s, int fd, { int hvm, rc; int flags = XCFLAGS_LIVE; + unsigned long vm_generationid_addr; if (!s->domid) { s->errstr = "checkpoint state not opened"; @@ -185,16 +186,28 @@ int checkpoint_start(checkpoint_state* s, int fd, hvm = s->domtype > dt_pv; if (hvm) { + char path[128]; + char *addr; + + sprintf(path, "/local/domain/%u/hvmloader/generation-id-address", s->domid); + addr = xs_read(s->xsh, XBT_NULL, path, NULL); + + vm_generationid_addr = (addr) ? strtoul(addr, NULL, 0) : 0; + free(addr); + flags |= XCFLAGS_HVM; if (switch_qemu_logdirty(s, 1)) return -1; + } else { + vm_generationid_addr = 0; } if (remus_flags & CHECKPOINT_FLAGS_COMPRESSION) flags |= XCFLAGS_CHECKPOINT_COMPRESS; callbacks->switch_qemu_logdirty = noop_switch_logdirty; - rc = xc_domain_save(s->xch, fd, s->domid, 0, 0, flags, callbacks, hvm); + rc = xc_domain_save(s->xch, fd, s->domid, 0, 0, flags, callbacks, hvm, + vm_generationid_addr); if (hvm) switch_qemu_logdirty(s, 0); |