ia64/xen-unstable

changeset 12607:7a5246955bef

Don't bail if the VM renaming at the end of saving doesn't succeed -- we
expect a failure if this is a localhost migration.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Tue Nov 28 11:35:10 2006 +0000 (2006-11-28)
parents ee70bf177981
children fa8b2059c5d8 62b0b520ea53
files tools/python/xen/xend/XendCheckpoint.py
line diff
     1.1 --- a/tools/python/xen/xend/XendCheckpoint.py	Tue Nov 28 11:31:46 2006 +0000
     1.2 +++ b/tools/python/xen/xend/XendCheckpoint.py	Tue Nov 28 11:35:10 2006 +0000
     1.3 @@ -37,6 +37,7 @@ def write_exact(fd, buf, errmsg):
     1.4      if os.write(fd, buf) != len(buf):
     1.5          raise XendError(errmsg)
     1.6  
     1.7 +
     1.8  def read_exact(fd, size, errmsg):
     1.9      buf  = '' 
    1.10      while size != 0: 
    1.11 @@ -50,7 +51,6 @@ def read_exact(fd, size, errmsg):
    1.12      return buf
    1.13  
    1.14  
    1.15 -
    1.16  def save(fd, dominfo, network, live, dst):
    1.17      write_exact(fd, SIGNATURE, "could not write guest state file: signature")
    1.18  
    1.19 @@ -97,7 +97,14 @@ def save(fd, dominfo, network, live, dst
    1.20          forkHelper(cmd, fd, saveInputHandler, False)
    1.21  
    1.22          dominfo.destroyDomain()
    1.23 -        dominfo.setName(domain_name)
    1.24 +        try:
    1.25 +            dominfo.setName(domain_name)
    1.26 +        except VmError:
    1.27 +            # Ignore this.  The name conflict (hopefully) arises because we
    1.28 +            # are doing localhost migration; if we are doing a suspend of a
    1.29 +            # persistent VM, we need the rename, and don't expect the
    1.30 +            # conflict.  This needs more thought.
    1.31 +            pass
    1.32  
    1.33      except Exception, exn:
    1.34          log.exception("Save failed on domain %s (%s).", domain_name,