]> xenbits.xensource.com Git - libvirt.git/commit
Simplify PCI hostdev prepare/re-attach using a pciDeviceList type
authorMark McLoughlin <markmc@redhat.com>
Mon, 17 Aug 2009 14:05:23 +0000 (15:05 +0100)
committerMark McLoughlin <markmc@redhat.com>
Tue, 18 Aug 2009 08:41:57 +0000 (09:41 +0100)
commit78675b228b76a83f83d64856bfb63b9e14c103a0
tree8fe4c524e65c04a61960249e5723a504aba8c88e
parent60ff07585ca8f7e639fed477e2e2cf79ce1c5c21
Simplify PCI hostdev prepare/re-attach using a pciDeviceList type

The qemuPrepareHostDevices() and qemuDomainReAttachHostDevices()
functions are clutter with a bunch of calls to pciGetDevice() and
pciFreeDevice() obscuring the basic logic.

Add a pciDeviceList type and add a qemuGetPciHostDeviceList() function
to build a list from a domain definition. Use this in prepare/re-attach
fto simplify things and eliminate the multiple pciGetDevice calls.

This is especially useful because in the next patch we need to iterate
the hostdevs list a third time and we also need a list type for keeping
track of active devices.

* src/pci.[ch]: add pciDeviceList type and also a per-device 'managed'
  property

* src/libvirt_private.syms: export the new functions

* src/qemu_driver.c: add qemuGetPciHostDeviceList() and re-write
  qemuPrepareHostDevices() and qemuDomainReAttachHostDevices() to use it
src/libvirt_private.syms
src/pci.c
src/pci.h
src/qemu_driver.c