mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
This patch adds a quick check to 'xm restore' that checks the
existence and readability of the file given. This fixes the issue detected in xm-tests 03_restore_badparm_neg and 04_restore_badfilename_neg. Signed-off-by: Dan Smith <danms@us.ibm.com> Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
1 parent
9427933f18
commit
0fae7b55e5
1 file changed
+4
@@ -188,6 +188,10 @@ def xm_restore(args):
|
||||
|
||||
savefile = os.path.abspath(args[0])
|
||||
|
||||
if not os.access(savefile, os.R_OK):
|
||||
err("xm restore: Unable to read file %s" % savefile)
|
||||
sys.exit(1)
|
||||
|
||||
from xen.xend.XendClient import server
|
||||
info = server.xend_domain_restore(savefile)
|
||||
PrettyPrint.prettyprint(info)
|
||||
|
||||