2ec6fae qemu_hotplug: separate Chr|Lease from other devices in DetachDevice switch

Authored and Committed by Laine Stump 5 years ago
    qemu_hotplug: separate Chr|Lease from other devices in DetachDevice switch
    
    The Chr and Lease devices have detach code that is too different from
    the other device types to handle with common functionality (which will
    soon be added at the end of qemuDomainDetachDeviceLive(). In order to
    make this difference obvious, move the cases for those two device
    types to the top of the switch statement in
    qemuDomainDetachDeviceLive(), have the cases return immediately so the
    future common code at the end of the function will be skipped, and
    also include some hopefully helpful comments to remind future
    maintainers why these two device types are treated differently.
    
    Any attempt to detach an unsupported device type should also skip the
    future common code at the end of the function, so the case for
    unsupported types is similarly changed from a simple break to a return
    -1.
    
    Signed-off-by: Laine Stump <laine@laine.org>
    ACKed-by: Peter Krempa <pkrempa@redhat.com>
    
        
file modified
+19 -7