direct-io.hg

changeset 11287:f66bae594691

Fix reboot and reconfigure of HVM guests when they are configured with an
empty CD-ROM drive.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Wed Aug 30 02:53:48 2006 +0100 (2006-08-30)
parents 5acf10969b1d
children a47951e59cbf
files tools/python/xen/xend/image.py tools/python/xen/xend/server/blkif.py
line diff
     1.1 --- a/tools/python/xen/xend/image.py	Wed Aug 30 01:20:01 2006 +0100
     1.2 +++ b/tools/python/xen/xend/image.py	Wed Aug 30 02:53:48 2006 +0100
     1.3 @@ -305,7 +305,7 @@ class HVMImageHandler(ImageHandler):
     1.4          for (name, info) in deviceConfig:
     1.5              if name == 'vbd':
     1.6                  uname = sxp.child_value(info, 'uname')
     1.7 -                if 'file:' in uname:
     1.8 +                if uname is not None and 'file:' in uname:
     1.9                      (_, vbdparam) = string.split(uname, ':', 1)
    1.10                      if not os.path.isfile(vbdparam):
    1.11                          raise VmError('Disk image does not exist: %s' %
     2.1 --- a/tools/python/xen/xend/server/blkif.py	Wed Aug 30 01:20:01 2006 +0100
     2.2 +++ b/tools/python/xen/xend/server/blkif.py	Wed Aug 30 02:53:48 2006 +0100
     2.3 @@ -52,10 +52,18 @@ class BlkifController(DevController):
     2.4          except ValueError:
     2.5              dev_type = "disk"
     2.6  
     2.7 -        try:
     2.8 -            (typ, params) = string.split(uname, ':', 1)
     2.9 -        except ValueError:
    2.10 -            (typ, params) = ("", "")
    2.11 +        if uname is None:
    2.12 +            if dev_type == 'cdrom':
    2.13 +                (typ, params) = ("", "")
    2.14 +            else:
    2.15 +                raise VmError(
    2.16 +                    'Block device must have physical details specified')
    2.17 +        else:
    2.18 +            try:
    2.19 +                (typ, params) = string.split(uname, ':', 1)
    2.20 +            except ValueError:
    2.21 +                (typ, params) = ("", "")
    2.22 +
    2.23          back = { 'dev'    : dev,
    2.24                   'type'   : typ,
    2.25                   'params' : params,