[virt-tools-list] [virt-manager PATCH 4/4]RFC: addhardware: enable setting controller model

Chen Hanxiao chenhanxiao at cn.fujitsu.com
Wed Apr 16 09:51:52 UTC 2014


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

diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index 60e8033..531282c 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -325,9 +325,6 @@ class vmmAddHardware(vmmGObjectUI):
         target_model = Gtk.ListStore(str, str)
         combo.set_model(target_model)
         uiutil.set_combo_text_column(combo, 1)
-        # FIXME: we should deal with controller model
-        combo.set_visible(False)
-        self.widget("controller-model-label").set_visible(False)
 
         # Available HW options
         is_local = not self.conn.is_remote()
@@ -1813,12 +1810,19 @@ class vmmAddHardware(vmmGObjectUI):
         controller_type = self.get_config_controller_type()
         model = self.get_config_controller_model()
         self._dev = VirtualController(conn)
-        # FIXME
-        model = "none"
+
+        for ctrl in self.vm.get_controller_devices():
+            # FIXME: some sync issue
+            if ctrl.type == "usb":
+                self.vm.remove_device(ctrl)
 
         if model == "ich9-ehci1":
-            # FIXME: for USB 2
-            pass
+            for dev in VirtualController.get_usb2_controllers(conn):
+                setattr(self._dev, "type", dev.type)
+                setattr(self._dev, "model", dev.model)
+                setattr(self._dev, "master_startport", dev.master_startport)
+                if dev.model != "ich9-uhci3":
+                    self.add_device()
         else:
             controllers = self.vm.get_controller_devices()
             controller_num = [x for x in controllers if
-- 
1.9.0




More information about the virt-tools-list mailing list