]> xenbits.xensource.com Git - libvirt.git/commitdiff
Replace use of virNodeDeviceReportError with virReportError
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 18 Jul 2012 11:42:38 +0000 (12:42 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 18 Jul 2012 18:34:26 +0000 (19:34 +0100)
Update the node device driver to use virReportError instead of
the virNodeDeviceReportError custom macro

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
cfg.mk
src/node_device/node_device_driver.c
src/node_device/node_device_driver.h
src/node_device/node_device_udev.c

diff --git a/cfg.mk b/cfg.mk
index d1a6d233aabaf66ac021bd1c8a8f133e65b11098..f2a7e29a816ff734abe9e858227ffe27aa58e06e 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -541,7 +541,6 @@ msg_gen_function += virLibNWFilterError
 msg_gen_function += virLibSecretError
 msg_gen_function += virLibStoragePoolError
 msg_gen_function += virLibStorageVolError
-msg_gen_function += virNodeDeviceReportError
 msg_gen_function += virNWFilterReportError
 msg_gen_function += virRaiseError
 msg_gen_function += virReportError
index b0a29cdd4674fa3a31cf116f986be04a390d0e7a..83db775d6b76250be188454779777b4f04b8cf07 100644 (file)
@@ -196,7 +196,7 @@ nodeDeviceLookupByName(virConnectPtr conn, const char *name)
     nodeDeviceUnlock(driver);
 
     if (!obj) {
-        virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
+        virReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
         goto cleanup;
     }
 
@@ -271,9 +271,9 @@ nodeDeviceGetXMLDesc(virNodeDevicePtr dev,
     nodeDeviceUnlock(driver);
 
     if (!obj) {
-        virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE,
-                                 _("no node device with matching name '%s'"),
-                                 dev->name);
+        virReportError(VIR_ERR_NO_NODE_DEVICE,
+                       _("no node device with matching name '%s'"),
+                       dev->name);
         goto cleanup;
     }
 
@@ -301,9 +301,9 @@ nodeDeviceGetParent(virNodeDevicePtr dev)
     nodeDeviceUnlock(driver);
 
     if (!obj) {
-        virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE,
-                                 _("no node device with matching name '%s'"),
-                                 dev->name);
+        virReportError(VIR_ERR_NO_NODE_DEVICE,
+                       _("no node device with matching name '%s'"),
+                       dev->name);
         goto cleanup;
     }
 
@@ -312,8 +312,8 @@ nodeDeviceGetParent(virNodeDevicePtr dev)
         if (!ret)
             virReportOOMError();
     } else {
-        virNodeDeviceReportError(VIR_ERR_INTERNAL_ERROR,
-                                 "%s", _("no parent for this device"));
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                       "%s", _("no parent for this device"));
     }
 
 cleanup:
@@ -337,9 +337,9 @@ nodeDeviceNumOfCaps(virNodeDevicePtr dev)
     nodeDeviceUnlock(driver);
 
     if (!obj) {
-        virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE,
-                                 _("no node device with matching name '%s'"),
-                                 dev->name);
+        virReportError(VIR_ERR_NO_NODE_DEVICE,
+                       _("no node device with matching name '%s'"),
+                       dev->name);
         goto cleanup;
     }
 
@@ -368,9 +368,9 @@ nodeDeviceListCaps(virNodeDevicePtr dev, char **const names, int maxnames)
     nodeDeviceUnlock(driver);
 
     if (!obj) {
-        virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE,
-                                 _("no node device with matching name '%s'"),
-                                 dev->name);
+        virReportError(VIR_ERR_NO_NODE_DEVICE,
+                       _("no node device with matching name '%s'"),
+                       dev->name);
         goto cleanup;
     }
 
@@ -414,8 +414,8 @@ nodeDeviceVportCreateDelete(const int parent_host,
         operation_file = LINUX_SYSFS_VPORT_DELETE_POSTFIX;
         break;
     default:
-        virNodeDeviceReportError(VIR_ERR_INTERNAL_ERROR,
-                                 _("Invalid vport operation (%d)"), operation);
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                       _("Invalid vport operation (%d)"), operation);
         retval = -1;
         goto cleanup;
         break;
@@ -487,8 +487,8 @@ get_time(time_t *t)
 
     *t = time(NULL);
     if (*t == (time_t)-1) {
-        virNodeDeviceReportError(VIR_ERR_INTERNAL_ERROR,
-                                 "%s", _("Could not get current time"));
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                       "%s", _("Could not get current time"));
 
         *t = 0;
         ret = -1;
@@ -593,7 +593,7 @@ nodeDeviceCreateXML(virConnectPtr conn,
      * we're returning what we get... */
 
     if (dev == NULL) {
-        virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
+        virReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
     }
 
 cleanup:
@@ -619,7 +619,7 @@ nodeDeviceDestroy(virNodeDevicePtr dev)
     nodeDeviceUnlock(driver);
 
     if (!obj) {
-        virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
+        virReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
         goto out;
     }
 
index c94e8706cae3273e85d0afb5842337ef673200f4..673e95b3aca1ace1fdaadb5dda44982b88097242 100644 (file)
 # include "driver.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_POSTFIX "device"
 # define LINUX_SYSFS_FC_HOST_PREFIX "/sys/class/fc_host/"
index 6418015a53db2cdb0ac8980fbd07216576d3855b..aa96abdb2104383b506680c6b297c6b8c524f4fb 100644 (file)
@@ -1241,9 +1241,9 @@ static int udevSetParent(struct udev_device *device,
 
         parent_sysfs_path = udev_device_get_syspath(parent_device);
         if (parent_sysfs_path == NULL) {
-            virNodeDeviceReportError(VIR_ERR_INTERNAL_ERROR,
-                                     _("Could not get syspath for parent of '%s'"),
-                                     udev_device_get_syspath(parent_device));
+            virReportError(VIR_ERR_INTERNAL_ERROR,
+                           _("Could not get syspath for parent of '%s'"),
+                           udev_device_get_syspath(parent_device));
             goto out;
         }