ia64/xen-unstable

changeset 15461:713bac7cba46

xend: Pass information to user when failing migrate due to PCI dev.

When failing a migration / save due to the domain owning a PCI device
make sure that we tell the user what went wrong!

Signed-off-by: Mark Williamson <mark.williamson@cl.cam.ac.uk>
author Keir Fraser <keir@xensource.com>
date Sun Jul 01 22:10:38 2007 +0100 (2007-07-01)
parents 2cdf8fef8d93
children 27e55a7358e2
files tools/python/xen/xend/XendCheckpoint.py tools/python/xen/xend/XendDomain.py
line diff
     1.1 --- a/tools/python/xen/xend/XendCheckpoint.py	Sun Jul 01 22:10:13 2007 +0100
     1.2 +++ b/tools/python/xen/xend/XendCheckpoint.py	Sun Jul 01 22:10:38 2007 +0100
     1.3 @@ -148,6 +148,8 @@ def save(fd, dominfo, network, live, dst
     1.4          except:
     1.5              log.exception("Failed to reset the migrating domain's name")
     1.6  
     1.7 +        raise exn
     1.8 +
     1.9  
    1.10  def restore(xd, fd, dominfo = None, paused = False):
    1.11      signature = read_exact(fd, len(SIGNATURE),
     2.1 --- a/tools/python/xen/xend/XendDomain.py	Sun Jul 01 22:10:13 2007 +0100
     2.2 +++ b/tools/python/xen/xend/XendDomain.py	Sun Jul 01 22:10:38 2007 +0100
     2.3 @@ -1262,8 +1262,10 @@ class XendDomain:
     2.4              try:
     2.5                  XendCheckpoint.save(fd, dominfo, False, False, dst,
     2.6                                      checkpoint=checkpoint)
     2.7 -            finally:
     2.8 +            except Exception, e:
     2.9                  os.close(fd)
    2.10 +                raise e
    2.11 +            os.close(fd)
    2.12          except OSError, ex:
    2.13              raise XendError("can't write guest state file %s: %s" %
    2.14                              (dst, ex[1]))