• O
    qemu: Honor the orginal PCI dev properties when reattaching · d0935478
    Osier Yang 提交于
    BZ# https://bugzilla.redhat.com/show_bug.cgi?id=736214
    
    The problem is caused by the original info of domain's PCI dev is
    maintained by qemu_driver->activePciHostdevs list, (E.g. dev->reprobe,
    which stands for whether need to reprobe driver for the dev when do
    reattachment). The fields (dev->reprobe, dev->unbind_from_stub, and
    dev->remove_slot) are initialized properly when preparing the PCI
    device for managed attachment. However, when do reattachment, it
    construct a complete new "pciDevice" without honoring the original
    dev info, and thus the dev won't get the original driver or can get
    other problem.
    
    This patch is to fix the problem by get the devs from list
    driver->activePciHostdevs.
    
    Tested with following 3 scenarios:
      * the PCI was bound to some driver not pci-stub before attaching
    
        result: the device will be bound to the original driver
    
      * the PCI was bound to pci-stub before attaching
    
        result: no driver reprobing, and still bound to pci-stub
    
      * The PCI was not bound to any driver
    
        result: no driver reprobing, and still not bound to any driver.
    d0935478
qemu_hostdev.c 12.2 KB