mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
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>
This commit is contained in:
1 parent
aab843f487
commit
01fa1a0693
2 files changed
+13
-5
No files matched your search
@@ -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' %
|
||||
|
||||
@@ -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,
|
||||
|
||||