]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
pci: new iommu_group functions
authorLaine Stump <laine@laine.org>
Sun, 23 Jun 2013 18:47:57 +0000 (14:47 -0400)
committerLaine Stump <laine@laine.org>
Wed, 26 Jun 2013 18:10:09 +0000 (14:10 -0400)
commit72c029d88365b051c59c62af4ab44aea29c815e9
tree698bb14dc8344645a62a71aac59e561ddb5e774d
parent5bc8ecb8d1170f41d4c177c1cf0e87c54194a3a3
pci: new iommu_group functions

Any device which belongs to an "IOMMU group" (used by vfio) will
have links to all devices of its group listed in
/sys/bus/pci/$device/iommu_group/devices;
/sys/bus/pci/$device/iommu_group is actually a link to
/sys/kernel/iommu_groups/$n, where $n is the group number (there
will be a corresponding device node at /dev/vfio/$n once the
devices are bound to the vfio-pci driver)

The following functions are added:

virPCIDeviceGetIOMMUGroupList

  Gets a virPCIDeviceList with one virPCIDeviceList for each device
  in the same IOMMU group as the provided virPCIDevice (a copy of the
  original device object is included in the list.

virPCIDeviceAddressIOMMUGroupIterate

  Calls the function @actor once for each device in the group that
  contains the given virPCIDeviceAddress.

virPCIDeviceAddressGetIOMMUGroupAddresses

  Fills in a virPCIDeviceAddressPtr * with an array of
  virPCIDeviceAddress, one for each device in the iommu group of the
  provided virPCIDeviceAddress (including a copy of the original).

virPCIDeviceAddressGetIOMMUGroupNum

  Returns the group number as an int (a valid group number will always
  be 0 or greater).  If there is no iommu_group link in the device's
  directory (usually indicating that vfio isn't loaded), -2 will be
  returned. On any real error, -1 will be returned.
src/libvirt_private.syms
src/util/virpci.c
src/util/virpci.h