]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: hotplug: Merge virtio and non-virtio disk unplug code
authorPeter Krempa <pkrempa@redhat.com>
Fri, 15 Mar 2019 14:09:14 +0000 (15:09 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 15 Mar 2019 15:11:20 +0000 (16:11 +0100)
commit0b7d544c8842841b27de0d88234148794ce4545e
tree5528c1d6b7b14ada223040d274973ceb1c065c76
parenteb437cfdf8f536293e4a4f5ff0f57058b7e6988a
qemu: hotplug: Merge virtio and non-virtio disk unplug code

The functions do basically exactly the same thing modulo few checks.
In case of virtio disks we check that the device is not multifunction as
that can't be unplugged at once. In case of USB and SCSI disks we
checked that no active block job is running.

The check for running blockjobs should have also been done for virtio
disks. By moving the multifunction check into the common function we fix
this case and also simplify the code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_hotplug.c