From: Jonathon Jongsma Date: Tue, 30 Mar 2021 15:12:07 +0000 (-0500) Subject: nodedev: avoid use of VIR_ERR_NO_* errors internally X-Git-Tag: v7.3.0-rc1~144 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14085ef98de4df7d677b29afd11abe1d7fa251b5;p=thirdparty%2Flibvirt.git nodedev: avoid use of VIR_ERR_NO_* errors internally These errors are demoted to debug statements[1] since they're only intended to be used as return values for public APIs. This makes it difficult to debug the problem when something goes wrong since no error message is logged. Switch instead to VIR_ERR_INTERNAL_ERROR so that the error is logged as expected. [1] See the implementation of daemonErrorLogFilter() for details: https://gitlab.com/libvirt/libvirt/-/blob/e2f82a3704f680fbb37a733476d870c19232c23e/src/remote/remote_daemon.c#L89 Signed-off-by: Jonathon Jongsma Reviewed-by: Laine Stump Reviewed-by: Erik Skultety --- diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c index 0d9e80fd23..ca3e956cae 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -724,7 +724,7 @@ nodeDeviceGetMdevctlDefineStartCommand(virNodeDeviceDef *def, g_autofree char *parent_addr = nodeDeviceFindAddressByName(def->parent); if (!parent_addr) { - virReportError(VIR_ERR_NO_NODE_DEVICE, + virReportError(VIR_ERR_INTERNAL_ERROR, _("unable to find parent device '%s'"), def->parent); return NULL; }