• M
    Simplify PCI hostdev prepare/re-attach using a pciDeviceList type · 78675b22
    Mark McLoughlin 提交于
    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
    78675b22
libvirt_private.syms 8.1 KB