ia64/xen-unstable

changeset 9119:7eafbed44734

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>
author kaf24@firebug.cl.cam.ac.uk
date Fri Mar 03 10:56:13 2006 +0100 (2006-03-03)
parents 0f368e70b4eb
children 4e7c8eae6775
files tools/python/xen/xend/image.py
line diff
     1.1 --- a/tools/python/xen/xend/image.py	Fri Mar 03 10:55:11 2006 +0100
     1.2 +++ b/tools/python/xen/xend/image.py	Fri Mar 03 10:56:13 2006 +0100
     1.3 @@ -274,6 +274,10 @@ class HVMImageHandler(ImageHandler):
     1.4                  uname = sxp.child_value(info, 'uname')
     1.5                  typedev = sxp.child_value(info, 'dev')
     1.6                  (_, vbdparam) = string.split(uname, ':', 1)
     1.7 +
     1.8 +                if 'file:' in uname and not os.path.isfile(vbdparam):
     1.9 +                   raise VmError('Disk image does not exist: %s' % vbdparam)
    1.10 +
    1.11                  if 'ioemu:' in typedev:
    1.12                      (emtype, vbddev) = string.split(typedev, ':', 1)
    1.13                  else: