]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu_hotplug: refactor qemuDomainDetachDiskLive and qemuDomainDetachDiskDevice
authorLaine Stump <laine@laine.org>
Mon, 18 Mar 2019 22:14:11 +0000 (18:14 -0400)
committerLaine Stump <laine@laine.org>
Mon, 25 Mar 2019 16:34:18 +0000 (12:34 -0400)
commitac442713e6aa1b1087d095796f9c35fd372a0511
tree2983afaf0a133fb5e13e9d07766d7bc2fd117d61
parent1ed46f3a22fe8570b4237477de5d5adb5a05f455
qemu_hotplug: refactor qemuDomainDetachDiskLive and qemuDomainDetachDiskDevice

qemuDomainDetachDiskDevice() is only called from one place. Moving the
contents of the function to that place makes
qemuDomainDetachDiskLive() more similar to the other Detach functions
called by the toplevel qemuDomainDetachDevice().

The goal is to make each of the device-type-specific functions do this:

  1) find the exact device
  2) do any device-specific validation
  3) do general validation
  4) do device-specific shutdown (only needed for net devices)
  5) do the common block of code to send device_del to qemu, then
     optionally wait for a corresponding DEVICE_DELETED event from
     qemu.

with the final aim being that only items 1 & 2 will remain in each
device-type-specific function, while 3 & 5 (which are the same for
almost every type) will be de-duplicated and moved to the toplevel
function that calls all of these (qemuDomainDetachDeviceLive(), which
will also contain a callout to the one instance of (4) (netdev).

Signed-off-by: Laine Stump <laine@laine.org>
ACKed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_hotplug.c