libvirt/src/network
Laine Stump f391889f4e nodedev: report maxCount for virtual_functions capability
A PCI device may have the capability to setup virtual functions (VFs)
but have them currently all disabled. Prior to this patch, if that was
the case the the node device XML for the device wouldn't report any
virtual_functions capability.

With this patch, if a file called "sriov_totalvfs" is found in the
device's sysfs directory, its contents will be interpreted as a
decimal number, and that value will be reported as "maxCount" in a
capability element of the device's XML, e.g.:

   <capability type='virtual_functions' maxCount='7'/>

This will be reported regardless of whether or not any VFs are
currently enabled for the device.

NB: sriov_numvfs (the number of VFs currently active) is also
available in sysfs, but that value is implied by the number of items
in the list that is inside the capability element, so there is no
reason to explicitly provide it as an attribute.

sriov_totalvfs and sriov_numvfs are available in kernels at least as far
back as the 2.6.32 that is in RHEL6.7, but in the case that they
simply aren't there, libvirt will behave as it did prior to this patch
- no maxCount will be displayed, and the virtual_functions capability
will be absent from the device's XML when 0 VFs are enabled.
2015-11-24 12:31:04 -05:00
..
bridge_driver_linux.c network: Add another collision check into networkCheckRouteCollision 2015-07-14 09:56:44 +02:00
bridge_driver_nop.c Replace virNetworkObjPtr with virNetworkDefPtr in network platform APIs 2014-04-25 15:44:09 +01:00
bridge_driver_platform.c bridge driver: extract platform specifics 2013-08-01 15:47:02 -06:00
bridge_driver_platform.h struct _virNetworkDriverState: Annotate items 2015-03-13 15:55:56 +01:00
bridge_driver.c nodedev: report maxCount for virtual_functions capability 2015-11-24 12:31:04 -05:00
bridge_driver.h bridge_driver: Introduce networkBandwidthUpdate 2015-08-11 16:10:32 +02:00
default.xml Remove the space before the slash in network XML 2013-08-28 08:05:46 +02:00
leaseshelper.c leaseshelper: Fix incorrect alignment of a switch case 2014-12-03 18:47:24 +01:00