[virt-tools-list] [virt-manager PATCH] disable adding virtio disk with device type 'LUN'

Chen Hanxiao chenhanxiao at cn.fujitsu.com
Mon Jan 20 12:33:38 UTC 2014


From: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>

We should not encourage user use device type 'LUN'
with virtio bus.
This patch will disable device type combobox
if user selected virtio bus.

Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
---
 virtManager/addhardware.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index d7ee161..2114d1b 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -577,6 +577,8 @@ class vmmAddHardware(vmmGObjectUI):
         cdrom_buses = ["ide", "scsi"]
         lun_buses = ["virtio", "virtio-scsi"]
 
+        self.widget("config-storage-devtype").set_sensitive(True)
+
         if bus in disk_buses:
             model.append([virtinst.VirtualDisk.DEVICE_DISK,
                           "drive-harddisk", _("Disk device")])
@@ -587,6 +589,8 @@ class vmmAddHardware(vmmGObjectUI):
             model.append([virtinst.VirtualDisk.DEVICE_CDROM,
                           "media-cdrom", _("CDROM device")])
         if bus in lun_buses:
+            if bus == "virtio":
+                self.widget("config-storage-devtype").set_sensitive(False)
             model.append([virtinst.VirtualDisk.DEVICE_LUN,
                           "drive-harddisk", _("LUN device")])
 
-- 
1.8.2.1




More information about the virt-tools-list mailing list