]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu_hotplug: remove unnecessary check for valid PCI address
authorLaine Stump <laine@laine.org>
Tue, 19 Mar 2019 22:57:45 +0000 (18:57 -0400)
committerLaine Stump <laine@laine.org>
Mon, 25 Mar 2019 16:34:18 +0000 (12:34 -0400)
commit155064e0ed53b13701ff176c3f92605b1a850a9d
treeda30233ee1f3958e5d247089750a7a42eda204f3
parente18e9b72a99f93cd4b14f39c60baa7c5ea35e5db
qemu_hotplug: remove unnecessary check for valid PCI address

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 apparently 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@laine.org>
ACKed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_hotplug.c