diff --git a/virtManager/details.py b/virtManager/details.py index e237cd9b..44dccb7a 100644 --- a/virtManager/details.py +++ b/virtManager/details.py @@ -3327,13 +3327,12 @@ class vmmDetails(vmmGObjectUI): type_label = virtinst.VirtualController.pretty_type(dev.type) model_label = dev.model - is_usb = dev.type == virtinst.VirtualController.TYPE_USB if not model_label: model_label = _("Default") self.widget("controller-type").set_text(type_label) combo = self.widget("controller-model") - uihelpers.set_grid_row_visible(combo, is_usb) + uihelpers.set_grid_row_visible(combo, True) model = combo.get_model() model.clear() @@ -3342,6 +3341,9 @@ class vmmDetails(vmmGObjectUI): model.append(["ich9-ehci1", "USB 2"]) model.append(["nec-xhci", "USB 3"]) self.widget("config-remove").set_sensitive(False) + if dev.type == virtinst.VirtualController.TYPE_SCSI: + model.append(["default", "Default"]) + model.append(["virtio-scsi", "Virtio SCSI"]) else: self.widget("config-remove").set_sensitive(True) diff --git a/virtManager/domain.py b/virtManager/domain.py index b4bce008..8f7032c6 100644 --- a/virtManager/domain.py +++ b/virtManager/domain.py @@ -825,23 +825,30 @@ class vmmDomain(vmmLibvirtObject): def change(editdev): ignore = editdev - guest = self._get_xmlobj_to_define() - ctrls = guest.get_devices("controller") - ctrls = [x for x in ctrls if (x.type == - VirtualController.TYPE_USB)] - for dev in ctrls: - guest.remove_device(dev) + if editdev.type == "usb": + guest = self._get_xmlobj_to_define() + ctrls = guest.get_devices("controller") + ctrls = [x for x in ctrls if (x.type == + VirtualController.TYPE_USB)] + for dev in ctrls: + guest.remove_device(dev) - if newmodel == "ich9-ehci1": - for dev in VirtualController.get_usb2_controllers( - guest.conn): + if newmodel == "ich9-ehci1": + for dev in VirtualController.get_usb2_controllers( + guest.conn): + guest.add_device(dev) + else: + dev = VirtualController(guest.conn) + dev.type = "usb" + if newmodel != "default": + dev.model = newmodel guest.add_device(dev) - else: - dev = VirtualController(guest.conn) - dev.type = "usb" - if newmodel != "default": - dev.model = newmodel - guest.add_device(dev) + elif editdev.type == "scsi": + if newmodel == "default": + editdev.model = None + else: + editdev.model = newmodel + self.update_device(editdev) return self._redefine_device(change, devobj)