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>
This commit is contained in:
Paul Durrant committed 2011-12-16 14:54:14 +00:00
1 parent be9b274df1
commit 8f76fc6c98
14 files changed
+130 -13

No files matched your search

@@ -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);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.