]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuDomainDiskControllerIsBusy: Fix logic of matching disk bus to controller type
authorPeter Krempa <pkrempa@redhat.com>
Fri, 13 Nov 2020 13:07:40 +0000 (14:07 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 16 Nov 2020 13:05:06 +0000 (14:05 +0100)
commit022f4d431b7fffc5caa28b9872a061360410e0b2
tree2cfc1ec721c3b31d1f394104b2f879d581b9ba59
parenta6d5a5712f68ee2f528b7f8b99feeec2c243ddf0
qemuDomainDiskControllerIsBusy: Fix logic of matching disk bus to controller type

The tests which match the disk bus to the controller type were backwards
in this function. This meant that any disk bus type (such as
VIR_DOMAIN_DISK_BUS_SATA) would not skip the controller index comparison
even if the removed controller was of a different type.

Switch the internals to a switch statement with selects the controller
type in the first place and a proper type so that new controller types
are added in the future.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1870072
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_hotplug.c