Fix a crash when restarting libvirtd.
Fix a crash when restarting libvirtd.

If you shutdown libvirtd while a domain with PCI
devices is running, then try to restart libvirtd,
libvirtd will crash.

This happens because qemuUpdateActivePciHostdevs() is calling
pciDeviceListSteal() with a dev of 0x0 (NULL), and then trying
to dereference it.  This patch fixes it up so that
qemuUpdateActivePciHostdevs() steals the devices after first
Get()'ting them, avoiding the crash.

Signed-off-by: Chris Lalancette <60b62644009db6b194cc0445b64e9b27bb26433a@redhat.com>

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