[libvirt PATCH 01/11] nodedev: don't log error in nodeDeviceFindAddressByName()

Jonathon Jongsma posted 11 patches 4 years, 10 months ago
There is a newer version of this series
[libvirt PATCH 01/11] nodedev: don't log error in nodeDeviceFindAddressByName()
Posted by Jonathon Jongsma 4 years, 10 months ago
The calling function will log the error. Just return NULL if a device
cannot be found.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
---
 src/node_device/node_device_driver.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index c11b8d89ab..cb90401d0a 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -630,11 +630,8 @@ nodeDeviceFindAddressByName(const char *name)
     char *addr = NULL;
     virNodeDeviceObjPtr dev = virNodeDeviceObjListFindByName(driver->devs, name);
 
-    if (!dev) {
-        virReportError(VIR_ERR_NO_NODE_DEVICE,
-                       _("could not find device '%s'"), name);
+    if (!dev)
         return NULL;
-    }
 
     def = virNodeDeviceObjGetDef(dev);
     for (caps = def->caps; caps != NULL; caps = caps->next) {
-- 
2.26.3