ia64/xen-unstable

changeset 19263:bb281d11fa99

xend: Make /var/lib/xen if not already present.
Signed-off-by: Christoph Egger <christoph.egger@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 03 11:37:31 2009 +0000 (2009-03-03)
parents 310c85c9cb86
children ae58b4403cae
files tools/python/xen/xend/XendCheckpoint.py
line diff
     1.1 --- a/tools/python/xen/xend/XendCheckpoint.py	Mon Mar 02 16:24:50 2009 +0000
     1.2 +++ b/tools/python/xen/xend/XendCheckpoint.py	Tue Mar 03 11:37:31 2009 +0000
     1.3 @@ -66,6 +66,13 @@ def insert_after(list, pred, value):
     1.4  
     1.5  
     1.6  def save(fd, dominfo, network, live, dst, checkpoint=False, node=-1):
     1.7 +    try:
     1.8 +        if not os.path.isdir("/var/lib/xen"):
     1.9 +            os.makedirs("/var/lib/xen")
    1.10 +    except Exception, exn:
    1.11 +        log.exception("Can't create directory '/var/lib/xen'")
    1.12 +        raise XendError("Can't create directory '/var/lib/xen'")
    1.13 +
    1.14      write_exact(fd, SIGNATURE, "could not write guest state file: signature")
    1.15  
    1.16      sxprep = dominfo.sxpr()
    1.17 @@ -166,6 +173,13 @@ def save(fd, dominfo, network, live, dst
    1.18  
    1.19  
    1.20  def restore(xd, fd, dominfo = None, paused = False, relocating = False):
    1.21 +    try:
    1.22 +        if not os.path.isdir("/var/lib/xen"):
    1.23 +            os.makedirs("/var/lib/xen")
    1.24 +    except Exception, exn:
    1.25 +        log.exception("Can't create directory '/var/lib/xen'")
    1.26 +        raise XendError("Can't create directory '/var/lib/xen'")
    1.27 +
    1.28      signature = read_exact(fd, len(SIGNATURE),
    1.29          "not a valid guest state file: signature read")
    1.30      if signature != SIGNATURE: