[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Raises an explicit error message when the domain config file specifies



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 7eafbed447340e98e027eff005a5bceffd752141
# Parent  0f368e70b4ebbbab4f6712b80e5704b47e29db9e
Raises an explicit error message when the domain config file specifies
an incorrect path to a file-backed VBD (disk image) or the file-backed
VBD does not exist.

Without this patch, if someone mis-types the path to the disk image,
he/she would have no indication as to what's wrong when the domain
fails to get created.

Signed-off-by: Khoa Huynh <khoa@xxxxxxxxxx>

diff -r 0f368e70b4eb -r 7eafbed44734 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Fri Mar  3 09:55:11 2006
+++ b/tools/python/xen/xend/image.py    Fri Mar  3 09:56:13 2006
@@ -274,6 +274,10 @@
                 uname = sxp.child_value(info, 'uname')
                 typedev = sxp.child_value(info, 'dev')
                 (_, vbdparam) = string.split(uname, ':', 1)
+
+                if 'file:' in uname and not os.path.isfile(vbdparam):
+                   raise VmError('Disk image does not exist: %s' % vbdparam)
+
                 if 'ioemu:' in typedev:
                     (emtype, vbddev) = string.split(typedev, ':', 1)
                 else:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.