]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: change virPCIGetNetName() to not return error if device has no net name
authorLaine Stump <laine@laine.org>
Fri, 3 Mar 2017 16:54:59 +0000 (11:54 -0500)
committerLaine Stump <laine@laine.org>
Fri, 24 Mar 2017 04:37:19 +0000 (00:37 -0400)
commitd6ee56d723761d408eeef32a96e3c118e0e742c2
tree323858f75b58453c38fa53ab2af23c406d2eefcd
parent30b07a425d7b5b3ac7ca68d3574692ac6415ccbe
util: change virPCIGetNetName() to not return error if device has no net name

...and cleanup the callers to report it when it *is* an error.

In many cases It's useful for virPCIGetNetName() to not log an error
and simply return a NULL pointer when the given device isn't bound to
a net driver (e.g. we're looking at a VF that is permanently bound to
vfio-pci). The existing code would silently return an error in this
case, which could eventually lead to the dreaded "An error occurred
but the cause is unknown" log message.

This patch changes virPCIGetNetName() to still return success if the
device simply isn't bound to a net driver, and adjusts all the callers
that require a non-null netname to check for that condition and log an
error when it happens.
src/util/virhostdev.c
src/util/virnetdev.c
src/util/virpci.c