diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py index acfd7047ee..0db2e8636d 100644 --- a/tools/python/xen/xm/main.py +++ b/tools/python/xen/xm/main.py @@ -175,6 +175,10 @@ def xm_save(args): dom = args[0] # TODO: should check if this exists savefile = os.path.abspath(args[1]) + + if not os.access(os.path.dirname(savefile), os.W_OK): + err("xm save: Unable to create file %s" % savefile) + sys.exit(1) from xen.xend.XendClient import server server.xend_domain_save(dom, savefile)