ia64/xen-unstable

changeset 15222:9073caff4b63

[XEND/XM] Improve error reporting in 'xm restore'.
From: Mats Petersson <Mats.Petersson@amd.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Fri May 25 10:23:16 2007 +0100 (2007-05-25)
parents 546044bfd49f
children a717cb2fac90
files tools/python/xen/xend/XendDomain.py tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Fri May 25 10:17:43 2007 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Fri May 25 10:23:16 2007 +0100
     1.3 @@ -1088,6 +1088,9 @@ class XendDomain:
     1.4  
     1.5          try:
     1.6              return XendCheckpoint.restore(self, fd, paused=paused)
     1.7 +        except XendError, e:
     1.8 +            log.exception("Restore failed")
     1.9 +            raise
    1.10          except:
    1.11              # I don't really want to log this exception here, but the error
    1.12              # handling in the relocation-socket handling code (relocate.py) is
     2.1 --- a/tools/python/xen/xm/main.py	Fri May 25 10:17:43 2007 +0100
     2.2 +++ b/tools/python/xen/xm/main.py	Fri May 25 10:23:16 2007 +0100
     2.3 @@ -732,10 +732,13 @@ def xm_restore(args):
     2.4          err("xm restore: Unable to read file %s" % savefile)
     2.5          sys.exit(1)
     2.6  
     2.7 -    if serverType == SERVER_XEN_API:
     2.8 -        server.xenapi.VM.restore(savefile, paused)
     2.9 -    else:
    2.10 -        server.xend.domain.restore(savefile, paused)
    2.11 +    try:
    2.12 +        if serverType == SERVER_XEN_API:
    2.13 +            server.xenapi.VM.restore(savefile, paused)
    2.14 +        else:
    2.15 +            server.xend.domain.restore(savefile, paused)
    2.16 +    except Exception, ex:
    2.17 +        err("%s" % ex.faultString)
    2.18  
    2.19  
    2.20  def datetime_to_secs(v):