From: Ewan Mellor Date: Wed, 30 Aug 2006 01:53:48 +0000 (+0100) Subject: Fix reboot and reconfigure of HVM guests when they are configured with an X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15673^2~23^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=01fa1a0693a669c27afcd228bb590c6127112a04;p=xen.git Fix reboot and reconfigure of HVM guests when they are configured with an empty CD-ROM drive. Signed-off-by: Ewan Mellor --- diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py index ad8720e54b..141482f065 100644 --- a/tools/python/xen/xend/image.py +++ b/tools/python/xen/xend/image.py @@ -305,7 +305,7 @@ class HVMImageHandler(ImageHandler): for (name, info) in deviceConfig: if name == 'vbd': uname = sxp.child_value(info, 'uname') - if 'file:' in uname: + if uname is not None and 'file:' in uname: (_, vbdparam) = string.split(uname, ':', 1) if not os.path.isfile(vbdparam): raise VmError('Disk image does not exist: %s' % diff --git a/tools/python/xen/xend/server/blkif.py b/tools/python/xen/xend/server/blkif.py index 0d895c71b7..886cc5610d 100644 --- a/tools/python/xen/xend/server/blkif.py +++ b/tools/python/xen/xend/server/blkif.py @@ -52,10 +52,18 @@ class BlkifController(DevController): except ValueError: dev_type = "disk" - try: - (typ, params) = string.split(uname, ':', 1) - except ValueError: - (typ, params) = ("", "") + if uname is None: + if dev_type == 'cdrom': + (typ, params) = ("", "") + else: + raise VmError( + 'Block device must have physical details specified') + else: + try: + (typ, params) = string.split(uname, ':', 1) + except ValueError: + (typ, params) = ("", "") + back = { 'dev' : dev, 'type' : typ, 'params' : params,