• K
    libvirt/qemu - clean up At(De)tachDeviceFlags() for consolidation. · 19ad136f
    KAMEZAWA Hiroyuki 提交于
    clean up At(De)tachDeviceFlags() for consolidation.
    
    qemuDomainAttachDeviceFlags()/qemuDomainDetachFlags()/
    qemuDomainUpdateDeviceFlags() has similar logics and copied codes.
    
    This patch series tries to unify them to use shared code when it can.
    At first, clean up At(De)tachDeviceFlags() and devide it into functions.
    
    By this, this patch pulls out shared components between functions.
    Based on patch series by Eric Blake, I added some modification as
    switch-case with QEMU_DEVICE_ATTACH, QEMU_DEVICE_DETACH, QEMU_DEVICE_UPDATE
    
    * src/qemu/qemu_driver.c
    (qemuDomainAt(De)tachDeviceFlags) : pulled out to qemuDomainModifyDeviceFlags()
    (qemuDomainModifyDeviceFlags) : implements generic code for modifying domain.
    (qemuDomainAt(De)tachDeviceFlagsLive) : code for at(de)taching devices to
    domain in line. no changes in logic from old code.
    (qemuDomainAt(De)tachDeviceDiskLive) : for at(de)taching Disks.
    (qemuDomainAt(De)tachDeviceControllerLive) : for at(de)taching Controllers
    Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
    Signed-off-by: NEric Blake <eblake@redhat.com>
    19ad136f
qemu_driver.c 212.8 KB