[et-mgmt-tools] [PATCH] recognize CD-ROM from guest OS after install
Nobuhiro Itou
fj0873gn at aa.jp.fujitsu.com
Wed May 23 08:08:45 UTC 2007
Hi,
I made the patch that the HVM domain after install has
non-source virtual CD-ROM device.
The effect of this patch is the following.
- Users doesn't need attach virtual CD-ROM device to install software and driver
after installing the domain.
- CD-ROM can be used only by executing xm block-configure.
Could you apply this correction?
Signed-off-by: Nobuhiro Itou <fj0873gn at aa.jp.fujitsu.com>
Thanks,
Nobuhiro Itou.
-----------------------------------------------------------
diff -r b5297ff8ca09 virtinst/FullVirtGuest.py
--- a/virtinst/FullVirtGuest.py Mon May 21 16:08:11 2007 -0400
+++ b/virtinst/FullVirtGuest.py Tue May 22 15:55:46 2007 +0900
@@ -228,7 +228,10 @@ class FullVirtGuest(Guest.XenGuest):
count = 0
for d in self.disks:
if d.transient and not install:
- continue
+ if d.device == Guest.VirtualDisk.DEVICE_CDROM:
+ d.path = None
+ else:
+ continue
if count > 4:
raise ValueError, "Can't use more than 4 disks on an HVM guest"
if d.device == Guest.VirtualDisk.DEVICE_CDROM and count != 2:
diff -r b5297ff8ca09 virtinst/Guest.py
--- a/virtinst/Guest.py Mon May 21 16:08:11 2007 -0400
+++ b/virtinst/Guest.py Tue May 22 19:11:32 2007 +0900
@@ -119,17 +119,20 @@ class VirtualDisk:
# FIXME: set selinux context?
def get_xml_config(self, disknode):
- typeattr = 'file'
- if self.type == VirtualDisk.TYPE_BLOCK:
- typeattr = 'dev'
-
- ret = " <disk type='%(type)s' device='%(device)s'>\n" % { "type": self.type, "device": self.device }
- if not(self.driver_name is None):
- if self.driver_type is None:
- ret += " <driver name='%(name)s'/>\n" % { "name": self.driver_name }
- else:
- ret += " <driver name='%(name)s' type='%(type)s'/>\n" % { "name": self.driver_name, "type": self.driver_type }
- ret += " <source %(typeattr)s='%(disk)s'/>\n" % { "typeattr": typeattr, "disk": self.path }
+ if self.path is None:
+ ret = " <disk device='%(device)s'>\n" % { "device": self.device }
+ else:
+ typeattr = 'file'
+ if self.type == VirtualDisk.TYPE_BLOCK:
+ typeattr = 'dev'
+
+ ret = " <disk type='%(type)s' device='%(device)s'>\n" % { "type": self.type, "device": self.device }
+ if not(self.driver_name is None):
+ if self.driver_type is None:
+ ret += " <driver name='%(name)s'/>\n" % { "name": self.driver_name }
+ else:
+ ret += " <driver name='%(name)s' type='%(type)s'/>\n" % { "name": self.driver_name, "type": self.driver_type }
+ ret += " <source %(typeattr)s='%(disk)s'/>\n" % { "typeattr": typeattr, "disk": self.path }
ret += " <target dev='%(disknode)s'/>\n" % { "disknode": disknode }
if self.read_only:
ret += " <readonly/>\n"
More information about the et-mgmt-tools
mailing list