]> xenbits.xensource.com Git - libvirt.git/commit
virPCIGetVirtualFunctions: Fetch also network interface name if needed
authorPeter Krempa <pkrempa@redhat.com>
Wed, 4 Aug 2021 15:37:44 +0000 (17:37 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 9 Aug 2021 08:09:00 +0000 (10:09 +0200)
commit795e9e05c3b6b9ef3abe6f6078a6373a136ec23b
tree47dd88d029d81b2a7d7ba2c3148257020a5225e6
parent7ef618f30a374a1fa5e206dd7cd9ff018aad0d36
virPCIGetVirtualFunctions: Fetch also network interface name if needed

'virNetDevGetVirtualFunctions' calls 'virPCIGetVirtualFunctions' and
then re-iterates the returned list to fetch the interface names for the
returned virtual functions.

If we move the fetching of the interface name into
virPCIGetVirtualFunctions we can simplify the code and remove a bunch of
impossible error states.

To accomplish this the function is renamed to
'virPCIGetVirtualFunctionsFull' while keeping a wrapper with original
name and if the physical port ID is passed the interface name is fetched
too without the need to re-convert the address into a sysfs link.

For now 'virNetDevGetVirtualFunctions' still converts the returned data
into two lists.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/libvirt_private.syms
src/util/virnetdev.c
src/util/virpci.c
src/util/virpci.h