From aabde5bbe6a4175c0fc6c89efe48bc98083e6b97 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 5 Jun 2019 18:50:28 -0400 Subject: [PATCH] domain: Remove pre-startup USB collision check Libvirt nowadays will throw an explicit warning about this exact situation. It doesn't guide people to virt-manager UI, but then again it should be obscure enough that it doesn't warrant this special corner case code to inform the user --- virtManager/domain.py | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/virtManager/domain.py b/virtManager/domain.py index 03fe9acc8..07785fdaf 100644 --- a/virtManager/domain.py +++ b/virtManager/domain.py @@ -177,7 +177,6 @@ class vmmDomain(vmmLibvirtObject): __gsignals__ = { "resources-sampled": (vmmLibvirtObject.RUN_FIRST, None, []), "inspection-changed": (vmmLibvirtObject.RUN_FIRST, None, []), - "pre-startup": (vmmLibvirtObject.RUN_FIRST, None, [object]), } def __init__(self, conn, backend, key): @@ -228,39 +227,6 @@ class vmmDomain(vmmLibvirtObject): # is blacklisted. raise RuntimeError("Can't track Domain-0 as a vmmDomain") - self.connect("pre-startup", self._prestartup_nodedev_check) - - def _prestartup_nodedev_check(self, src, ret): - ignore = src - error = _("There is more than one '%s' device attached to " - "your host, and we can't determine which one to " - "use for your guest.\n" - "To fix this, remove and reattach the USB device " - "to your guest using the 'Add Hardware' wizard.") - - usb_nodedevs = self.conn.filter_nodedevs("usb_device") - - for hostdev in self.xmlobj.devices.hostdev: - devtype = hostdev.type - - if devtype != "usb": - continue - - vendor = hostdev.vendor - product = hostdev.product - bus = hostdev.bus - device = hostdev.device - - if not vendor or not product: - continue - - count = len([d for d in usb_nodedevs if - (d.xmlobj.vendor_id == vendor and - d.xmlobj.product_id == product)]) - if count > 1 and not (bus and device): - prettyname = "%s %s" % (vendor, product) - ret.append(error % prettyname) - ########################### # Misc API getter methods # @@ -1317,13 +1283,6 @@ class vmmDomain(vmmLibvirtObject): if self.get_cloning(): raise RuntimeError(_("Cannot start guest while cloning " "operation in progress")) - - pre_startup_ret = [] - self.emit("pre-startup", pre_startup_ret) - - for error in pre_startup_ret: - raise RuntimeError(error) - self._backend.create() @vmmLibvirtObject.lifecycle_action