• L
    qemu_hotplug: refactor qemuDomainDetachDiskLive and qemuDomainDetachDiskDevice · ac442713
    Laine Stump 提交于
    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: NLaine Stump <laine@laine.org>
    ACKed-by: NPeter Krempa <pkrempa@redhat.com>
    ac442713
qemu_hotplug.c 215.0 KB