# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Node ID f66bae59469160a1d3cdbcc9dcf9efdfe188a672
# Parent 5acf10969b1d1a9da4f8cd45ddb55aa6463f9984
Fix reboot and reconfigure of HVM guests when they are configured with an
empty CD-ROM drive.
Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
tools/python/xen/xend/image.py | 2 +-
tools/python/xen/xend/server/blkif.py | 16 ++++++++++++----
2 files changed, 13 insertions(+), 5 deletions(-)
diff -r 5acf10969b1d -r f66bae594691 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py Wed Aug 30 01:20:01 2006 +0100
+++ b/tools/python/xen/xend/image.py Wed Aug 30 02:53:48 2006 +0100
@@ -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 -r 5acf10969b1d -r f66bae594691 tools/python/xen/xend/server/blkif.py
--- a/tools/python/xen/xend/server/blkif.py Wed Aug 30 01:20:01 2006 +0100
+++ b/tools/python/xen/xend/server/blkif.py Wed Aug 30 02:53:48 2006 +0100
@@ -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,
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|