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@us.ibm.com>
This commit is contained in:
kaf24@firebug.cl.cam.ac.uk committed 2006-03-03 10:56:13 +01:00
1 parent 6d794f8a04
commit da53848714
1 file changed
+4
+4
View File
@@ -274,6 +274,10 @@ class HVMImageHandler(ImageHandler):
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:
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.