mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
Enable 'live' migration from a tools pov; prior to this the 'live' flag was
being ignored by xend/xc_linux_save. Signed-off-by: Steven Hand <steven@xensource.com>
This commit is contained in:
1 parent
d7d77c20cf
commit
01d0370a52
5 files changed
+65
-32
No files matched your search
@@ -34,7 +34,7 @@ def read_exact(fd, size, errmsg):
|
||||
raise XendError(errmsg)
|
||||
return buf
|
||||
|
||||
def save(xd, fd, dominfo):
|
||||
def save(xd, fd, dominfo, live):
|
||||
write_exact(fd, SIGNATURE, "could not write guest state file: signature")
|
||||
|
||||
config = sxp.to_string(dominfo.sxpr())
|
||||
@@ -42,8 +42,13 @@ def save(xd, fd, dominfo):
|
||||
"could not write guest state file: config len")
|
||||
write_exact(fd, config, "could not write guest state file: config")
|
||||
|
||||
# xc_save takes three customization parameters: maxit, max_f, and flags
|
||||
# the last controls whether or not save is 'live', while the first two
|
||||
# further customize behaviour when 'live' save is enabled. Passing "0"
|
||||
# simply uses the defaults compiled into libxenguest; see the comments
|
||||
# and/or code in xc_linux_save() for more information.
|
||||
cmd = [PATH_XC_SAVE, str(xc.handle()), str(fd),
|
||||
str(dominfo.id)]
|
||||
str(dominfo.id), "0", "0", str(live) ]
|
||||
log.info("[xc_save] " + join(cmd))
|
||||
child = xPopen3(cmd, True, -1, [fd, xc.handle()])
|
||||
|
||||
|
||||
@@ -542,7 +542,7 @@ class XendDomain:
|
||||
dominfo.name = "tmp-" + dominfo.name
|
||||
|
||||
try:
|
||||
XendCheckpoint.save(self, sock.fileno(), dominfo)
|
||||
XendCheckpoint.save(self, sock.fileno(), dominfo, live)
|
||||
except:
|
||||
if dst == "localhost":
|
||||
dominfo.name = string.replace(dominfo.name, "tmp-", "", 1)
|
||||
@@ -563,7 +563,8 @@ class XendDomain:
|
||||
|
||||
fd = os.open(dst, os.O_WRONLY | os.O_CREAT | os.O_TRUNC)
|
||||
|
||||
return XendCheckpoint.save(self, fd, dominfo)
|
||||
# For now we don't support 'live checkpoint'
|
||||
return XendCheckpoint.save(self, fd, dominfo, False)
|
||||
|
||||
except OSError, ex:
|
||||
raise XendError("can't write guest state file %s: %s" %
|
||||
|
||||