mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
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:
1 parent
6d794f8a04
commit
da53848714
1 file changed
+4
@@ -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:
|
||||
|
||||