[PATCH 03/21] qemu_hotplug: remove unnecessary check for valid PCI address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When support for hotplug/unplug of SCSI controllers was added way back
in December 2009 (commit da9d937b), unplug was handled by calling the
now-extinct function qemuMonitorRemovePCIDevice(), which required a
PCI address as an argument. At the same time, the idea of every device
in the config having a PCI address apparentlty was not yet fully
implemented, because the author of the patch including a check for a
valid PCI address in the device object.

These days, all PCI devices are guaranteed to have a valid PCI
address. But more important than that, we no longer detach devices by
PCI address, but instead use qemuDomainDeleteDevice(), which
identifies the device by its alias. So checking for a valid PCI
address is just pointless extra code that obscures the high level of
similarity between all the individual qemuDomainDetach*Device()
functions.

Signed-off-by: Laine Stump <laine@xxxxxxxxx>
---
 src/qemu/qemu_hotplug.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 65ec5187e6..f2aa3cc048 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -5467,22 +5467,6 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
 
     detach = vm->def->controllers[idx];
 
-    if (detach->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
-        detach->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW &&
-        detach->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390) {
-        virReportError(VIR_ERR_OPERATION_FAILED,
-                       _("device with '%s' address cannot be detached"),
-                       virDomainDeviceAddressTypeToString(detach->info.type));
-        goto cleanup;
-    }
-
-    if (!virDomainDeviceAddressIsValid(&detach->info, detach->info.type)) {
-        virReportError(VIR_ERR_OPERATION_FAILED,
-                       _("device with invalid '%s' address cannot be detached"),
-                       virDomainDeviceAddressTypeToString(detach->info.type));
-        goto cleanup;
-    }
-
     if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
         virReportError(VIR_ERR_OPERATION_FAILED,
                        _("cannot hot unplug multifunction PCI device: %s"),
-- 
2.20.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux