qemu: Honor the orginal PCI dev properties when reattaching
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.

siboulet/libvirt-openvz,jfehlig/libvirt,fabianfreyer/libvirt,cbosdo/libvirt,jardasgit/libvirt,danwent/libvirt-ovs,trainstack/libvirt,siboulet/libvirt-openvz,leilihh/libvirt,warewolf/libvirt,foomango/libvirt,dumbbell/libvirt,bjzhang/libvirt,wiedi/libvirt,leilihh/libvirt,wiedi/libvirt,elmarco/libvirt,olafhering/libvirt,siboulet/libvirt-openvz,fabianfreyer/libvirt,soulxu/libvirt-xuhj,shugaoye/libvirt,emaste/libvirt,emaste/libvirt,taget/libvirt,novel/fbsd-libvirt,andreabolognani/libvirt,rmarwaha/libvirt1,leilihh/libvirt,bjzhang/libvirt,fabianfreyer/libvirt,wiedi/libvirt,warewolf/libvirt,leilihh/libvirt,wiedi/libvirt,iam-TJ/libvirt,fabianfreyer/libvirt,iam-TJ/libvirt,VenkatDatta/libvirt,danwent/libvirt-ovs,iam-TJ/libvirt,eskultety/libvirt,dumbbell/libvirt,trainstack/libvirt,novel/fbsd-libvirt,trainstack/libvirt,shugaoye/libvirt,warewolf/libvirt,warewolf/libvirt,warewolf/libvirt,libvirt/libvirt,wiedi/libvirt,danwent/libvirt-ovs,rmarwaha/libvirt1,novel/fbsd-libvirt,iam-TJ/libvirt,rlaager/libvirt,elmarco/libvirt,jeckersb/libvirt,agx/libvirt,iam-TJ/libvirt,jfehlig/libvirt,rlaager/libvirt,eskultety/libvirt,datto/libvirt,crobinso/libvirt,eskultety/libvirt,cbosdo/libvirt,siboulet/libvirt-openvz,VenkatDatta/libvirt,leilihh/libvirt,crobinso/libvirt,iam-TJ/libvirt,jeckersb/libvirt,jeckersb/libvirt,wiedi/libvirt,andreabolognani/libvirt,taget/libvirt,zhlcindy/libvirt-1.1.4-maintain,novel/fbsd-libvirt,shugaoye/libvirt,zippy2/libvirt,elmarco/libvirt,agx/libvirt,taget/libvirt,rmarwaha/libvirt,crobinso/libvirt,usc-isi/libvirt,rlaager/libvirt,rmarwaha/libvirt1,VenkatDatta/libvirt,zhlcindy/libvirt-1.1.4-maintain,zippy2/libvirt,usc-isi/libvirt,cbosdo/libvirt,jfehlig/libvirt,jardasgit/libvirt,danwent/libvirt-ovs,eskultety/libvirt,trainstack/libvirt,rmarwaha/libvirt,zippy2/libvirt,nertpinx/libvirt,libvirt/libvirt,rmarwaha/libvirt1,leilihh/libvirt,bjzhang/libvirt,zippy2/libvirt,libvirt/libvirt,rlaager/libvirt,nertpinx/libvirt,VenkatDatta/libvirt,dumbbell/libvirt,elmarco/libvirt,dumbbell/libvirt,shugaoye/libvirt,cbosdo/libvirt,olafhering/libvirt,soulxu/libvirt-xuhj,dumbbell/libvirt,crobinso/libvirt,jfehlig/libvirt,nertpinx/libvirt,cbosdo/libvirt,jeckersb/libvirt,nertpinx/libvirt,datto/libvirt,rmarwaha/libvirt,datto/libvirt,jeckersb/libvirt,trainstack/libvirt,rmarwaha/libvirt,soulxu/libvirt-xuhj,andreabolognani/libvirt,zhlcindy/libvirt-1.1.4-maintain,jardasgit/libvirt,fabianfreyer/libvirt,shugaoye/libvirt,soulxu/libvirt-xuhj,taget/libvirt,foomango/libvirt,andreabolognani/libvirt,zhlcindy/libvirt-1.1.4-maintain,olafhering/libvirt,novel/fbsd-libvirt,wiedi/libvirt,datto/libvirt,usc-isi/libvirt,emaste/libvirt,novel/fbsd-libvirt,iam-TJ/libvirt,soulxu/libvirt-xuhj,datto/libvirt,rmarwaha/libvirt1,emaste/libvirt,warewolf/libvirt,dumbbell/libvirt,bjzhang/libvirt,rmarwaha/libvirt1,trainstack/libvirt,usc-isi/libvirt,olafhering/libvirt,VenkatDatta/libvirt,warewolf/libvirt,rlaager/libvirt,siboulet/libvirt-openvz,andreabolognani/libvirt,novel/fbsd-libvirt,eskultety/libvirt,agx/libvirt,taget/libvirt,rmarwaha/libvirt,emaste/libvirt,jardasgit/libvirt,novel/fbsd-libvirt,emaste/libvirt,nertpinx/libvirt,libvirt/libvirt,rmarwaha/libvirt,trainstack/libvirt,foomango/libvirt,jeckersb/libvirt,foomango/libvirt,elmarco/libvirt,emaste/libvirt,usc-isi/libvirt,jeckersb/libvirt,agx/libvirt,zhlcindy/libvirt-1.1.4-maintain,agx/libvirt,jardasgit/libvirt,bjzhang/libvirt,foomango/libvirt,novel/fbsd-libvirt,danwent/libvirt-ovs