]> xenbits.xensource.com Git - libvirt.git/commit
qemu: Honor the orginal PCI dev properties when reattaching
authorOsier Yang <jyang@redhat.com>
Thu, 13 Oct 2011 08:30:21 +0000 (16:30 +0800)
committerEric Blake <eblake@redhat.com>
Fri, 14 Oct 2011 20:56:05 +0000 (14:56 -0600)
commitd09354786aaa7e1d384b0158b446cc783425d0de
treeb3062660614b8d2c96f170753739ccf0c0c6afb1
parent80b077ee5ea0dd899b87d370f9fa892e727832f5
qemu: Honor the orginal PCI dev properties when reattaching

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.
src/qemu/qemu_hostdev.c