提交 df5232f5 编写于 作者: D Daniel P. Berrange

Replace use of virNodeDeviceReportError with virReportError

Update the node device driver to use virReportError instead of
the virNodeDeviceReportError custom macro
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 54e520d3
...@@ -541,7 +541,6 @@ msg_gen_function += virLibNWFilterError ...@@ -541,7 +541,6 @@ msg_gen_function += virLibNWFilterError
msg_gen_function += virLibSecretError msg_gen_function += virLibSecretError
msg_gen_function += virLibStoragePoolError msg_gen_function += virLibStoragePoolError
msg_gen_function += virLibStorageVolError msg_gen_function += virLibStorageVolError
msg_gen_function += virNodeDeviceReportError
msg_gen_function += virNWFilterReportError msg_gen_function += virNWFilterReportError
msg_gen_function += virRaiseError msg_gen_function += virRaiseError
msg_gen_function += virReportError msg_gen_function += virReportError
......
...@@ -196,7 +196,7 @@ nodeDeviceLookupByName(virConnectPtr conn, const char *name) ...@@ -196,7 +196,7 @@ nodeDeviceLookupByName(virConnectPtr conn, const char *name)
nodeDeviceUnlock(driver); nodeDeviceUnlock(driver);
if (!obj) { if (!obj) {
virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE, NULL); virReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
goto cleanup; goto cleanup;
} }
...@@ -271,9 +271,9 @@ nodeDeviceGetXMLDesc(virNodeDevicePtr dev, ...@@ -271,9 +271,9 @@ nodeDeviceGetXMLDesc(virNodeDevicePtr dev,
nodeDeviceUnlock(driver); nodeDeviceUnlock(driver);
if (!obj) { if (!obj) {
virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE, virReportError(VIR_ERR_NO_NODE_DEVICE,
_("no node device with matching name '%s'"), _("no node device with matching name '%s'"),
dev->name); dev->name);
goto cleanup; goto cleanup;
} }
...@@ -301,9 +301,9 @@ nodeDeviceGetParent(virNodeDevicePtr dev) ...@@ -301,9 +301,9 @@ nodeDeviceGetParent(virNodeDevicePtr dev)
nodeDeviceUnlock(driver); nodeDeviceUnlock(driver);
if (!obj) { if (!obj) {
virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE, virReportError(VIR_ERR_NO_NODE_DEVICE,
_("no node device with matching name '%s'"), _("no node device with matching name '%s'"),
dev->name); dev->name);
goto cleanup; goto cleanup;
} }
...@@ -312,8 +312,8 @@ nodeDeviceGetParent(virNodeDevicePtr dev) ...@@ -312,8 +312,8 @@ nodeDeviceGetParent(virNodeDevicePtr dev)
if (!ret) if (!ret)
virReportOOMError(); virReportOOMError();
} else { } else {
virNodeDeviceReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("no parent for this device")); "%s", _("no parent for this device"));
} }
cleanup: cleanup:
...@@ -337,9 +337,9 @@ nodeDeviceNumOfCaps(virNodeDevicePtr dev) ...@@ -337,9 +337,9 @@ nodeDeviceNumOfCaps(virNodeDevicePtr dev)
nodeDeviceUnlock(driver); nodeDeviceUnlock(driver);
if (!obj) { if (!obj) {
virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE, virReportError(VIR_ERR_NO_NODE_DEVICE,
_("no node device with matching name '%s'"), _("no node device with matching name '%s'"),
dev->name); dev->name);
goto cleanup; goto cleanup;
} }
...@@ -368,9 +368,9 @@ nodeDeviceListCaps(virNodeDevicePtr dev, char **const names, int maxnames) ...@@ -368,9 +368,9 @@ nodeDeviceListCaps(virNodeDevicePtr dev, char **const names, int maxnames)
nodeDeviceUnlock(driver); nodeDeviceUnlock(driver);
if (!obj) { if (!obj) {
virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE, virReportError(VIR_ERR_NO_NODE_DEVICE,
_("no node device with matching name '%s'"), _("no node device with matching name '%s'"),
dev->name); dev->name);
goto cleanup; goto cleanup;
} }
...@@ -414,8 +414,8 @@ nodeDeviceVportCreateDelete(const int parent_host, ...@@ -414,8 +414,8 @@ nodeDeviceVportCreateDelete(const int parent_host,
operation_file = LINUX_SYSFS_VPORT_DELETE_POSTFIX; operation_file = LINUX_SYSFS_VPORT_DELETE_POSTFIX;
break; break;
default: default:
virNodeDeviceReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid vport operation (%d)"), operation); _("Invalid vport operation (%d)"), operation);
retval = -1; retval = -1;
goto cleanup; goto cleanup;
break; break;
...@@ -487,8 +487,8 @@ get_time(time_t *t) ...@@ -487,8 +487,8 @@ get_time(time_t *t)
*t = time(NULL); *t = time(NULL);
if (*t == (time_t)-1) { if (*t == (time_t)-1) {
virNodeDeviceReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Could not get current time")); "%s", _("Could not get current time"));
*t = 0; *t = 0;
ret = -1; ret = -1;
...@@ -593,7 +593,7 @@ nodeDeviceCreateXML(virConnectPtr conn, ...@@ -593,7 +593,7 @@ nodeDeviceCreateXML(virConnectPtr conn,
* we're returning what we get... */ * we're returning what we get... */
if (dev == NULL) { if (dev == NULL) {
virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE, NULL); virReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
} }
cleanup: cleanup:
...@@ -619,7 +619,7 @@ nodeDeviceDestroy(virNodeDevicePtr dev) ...@@ -619,7 +619,7 @@ nodeDeviceDestroy(virNodeDevicePtr dev)
nodeDeviceUnlock(driver); nodeDeviceUnlock(driver);
if (!obj) { if (!obj) {
virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE, NULL); virReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
goto out; goto out;
} }
......
...@@ -28,10 +28,6 @@ ...@@ -28,10 +28,6 @@
# include "driver.h" # include "driver.h"
# include "node_device_conf.h" # include "node_device_conf.h"
# define virNodeDeviceReportError(code, ...) \
virReportErrorHelper(VIR_FROM_NODEDEV, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__)
# define LINUX_SYSFS_SCSI_HOST_PREFIX "/sys/class/scsi_host/" # define LINUX_SYSFS_SCSI_HOST_PREFIX "/sys/class/scsi_host/"
# define LINUX_SYSFS_SCSI_HOST_POSTFIX "device" # define LINUX_SYSFS_SCSI_HOST_POSTFIX "device"
# define LINUX_SYSFS_FC_HOST_PREFIX "/sys/class/fc_host/" # define LINUX_SYSFS_FC_HOST_PREFIX "/sys/class/fc_host/"
......
...@@ -1241,9 +1241,9 @@ static int udevSetParent(struct udev_device *device, ...@@ -1241,9 +1241,9 @@ static int udevSetParent(struct udev_device *device,
parent_sysfs_path = udev_device_get_syspath(parent_device); parent_sysfs_path = udev_device_get_syspath(parent_device);
if (parent_sysfs_path == NULL) { if (parent_sysfs_path == NULL) {
virNodeDeviceReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not get syspath for parent of '%s'"), _("Could not get syspath for parent of '%s'"),
udev_device_get_syspath(parent_device)); udev_device_get_syspath(parent_device));
goto out; goto out;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册