ia64/xen-unstable

changeset 7077:c9d690c52afc

This patch adds a quick check in "xm save" to make sure the path given
exists, and is writable.

This will fix the issue detected by xm-test 03_save_bogusfile_neg.

Signed-off-by: Dan Smith <danms@us.ibm.com>
Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@ewan
date Tue Sep 27 15:06:40 2005 +0100 (2005-09-27)
parents 9575efe88e75
children fa4cc3f53c64 a4ad6692193a
files tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xm/main.py	Tue Sep 27 15:03:00 2005 +0100
     1.2 +++ b/tools/python/xen/xm/main.py	Tue Sep 27 15:06:40 2005 +0100
     1.3 @@ -175,6 +175,10 @@ def xm_save(args):
     1.4  
     1.5      dom = args[0] # TODO: should check if this exists
     1.6      savefile = os.path.abspath(args[1])
     1.7 +
     1.8 +    if not os.access(os.path.dirname(savefile), os.W_OK):
     1.9 +        err("xm save: Unable to create file %s" % savefile)
    1.10 +        sys.exit(1)
    1.11      
    1.12      from xen.xend.XendClient import server
    1.13      server.xend_domain_save(dom, savefile)