]> git.ipfire.org Git - thirdparty/libvirt.git/commit
node_device: replace duplicated code in hal and udev backends
authorLaine Stump <laine@laine.org>
Mon, 11 May 2015 17:50:37 +0000 (13:50 -0400)
committerLaine Stump <laine@laine.org>
Mon, 18 May 2015 14:34:01 +0000 (10:34 -0400)
commitd52d7a64b083645cbd355a34476963d1623b617a
tree03b0698e1c00d4bfe13691aab386ef99de9e0453
parent601b0fa872136951cd7d0745d99cfb1359367b0f
node_device: replace duplicated code in hal and udev backends

Both the hal and udev drivers call virPCI*() functions to the the
SRIOV VF/PF info about PCI devices, and the UDEV backend calls
virPCI*() to get IOMMU group info. Since there is now a single
function call in node_device_linux_sysfs.c to do all of this, replace
all that code in the two backends with calls to
nodeDeviceSysfsGetPCIRelatedDevCaps().

Note that this results in the HAL driver (probably) unnecessarily
calling virPCIDevieAddressGetIOMMUGroupNum(), but in the case that the
host doesn't support IOMMU groups, that function turns into a NOP (it
returns -2, which causes the caller to skip the call to
virPCIDeviceAddressGetIOMMUGroupAddresses()). So in the worst case it
is a few extra cycles spent, and in the best case a mythical platform
that supported IOMMU groups but used HAL rather than UDEV would gain
proper reporting of IOMMU group info.
src/node_device/node_device_hal.c
src/node_device/node_device_udev.c