nodedev: don't log error in nodeDeviceFindAddressByName()

The calling function will log the error. Just return NULL if a device
cannot be found.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
Jonathon Jongsma 2021-04-09 14:29:43 -05:00
parent 4ea5819d6e
commit 67ca558f5c

View File

@ -645,11 +645,8 @@ nodeDeviceFindAddressByName(const char *name)
char *addr = NULL;
virNodeDeviceObj *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) {