[PATCH 1/3] Turn libvirt.c error reporting functions into macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The virLibConnError() function (and related ones) do not correctly
report line number info. Turn them all into macros so line numbers
are reported correctly. Drop the connection object in all of them
since it is no longer used.

Also from the virLibConnWarning() equivalents completely. Now
that the Xen driver is running 100% inside libvirtd, those
codepaths for secondary drivers cannot be reached.

* src/libvirt.c: Replace error functions with macros
---
 src/libvirt.c | 1708 ++++++++++++++++++++++++---------------------------------
 1 files changed, 717 insertions(+), 991 deletions(-)

diff --git a/src/libvirt.c b/src/libvirt.c
index 52d3278..d47afbe 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -468,284 +468,40 @@ DllMain (HINSTANCE instance ATTRIBUTE_UNUSED,
 }
 #endif
 
-
-/**
- * virLibConnError:
- * @conn: the connection if available
- * @error: the error number
- * @info: extra information string
- *
- * Handle an error at the connection level
- */
-static void
-virLibConnError(virConnectPtr conn, virErrorNumber error, const char *info)
-{
-    const char *errmsg;
-
-    if (error == VIR_ERR_OK)
-        return;
-
-    errmsg = virErrorMsg(error, info);
-    virRaiseError(conn, NULL, NULL, VIR_FROM_NONE, error, VIR_ERR_ERROR,
-                  errmsg, info, NULL, 0, 0, errmsg, info);
-}
-
-/**
- * virLibConnWarning:
- * @conn: the connection if available
- * @error: the error number
- * @info: extra information string
- *
- * Handle an error at the connection level
- */
-static void
-virLibConnWarning(virConnectPtr conn, virErrorNumber error, const char *info)
-{
-    const char *errmsg;
-
-    if (error == VIR_ERR_OK)
-        return;
-
-    errmsg = virErrorMsg(error, info);
-    virRaiseError(conn, NULL, NULL, VIR_FROM_NONE, error, VIR_ERR_WARNING,
-                  errmsg, info, NULL, 0, 0, errmsg, info);
-}
-
-/**
- * virLibDomainError:
- * @domain: the domain if available
- * @error: the error number
- * @info: extra information string
- *
- * Handle an error at the connection level
- */
-static void
-virLibDomainError(virDomainPtr domain, virErrorNumber error,
-                  const char *info)
-{
-    virConnectPtr conn = NULL;
-    const char *errmsg;
-
-    if (error == VIR_ERR_OK)
-        return;
-
-    errmsg = virErrorMsg(error, info);
-    if (error != VIR_ERR_INVALID_DOMAIN) {
-        conn = domain->conn;
-    }
-    virRaiseError(conn, domain, NULL, VIR_FROM_DOM, error, VIR_ERR_ERROR,
-                  errmsg, info, NULL, 0, 0, errmsg, info);
-}
-
-/**
- * virLibNetworkError:
- * @conn: the connection if available
- * @error: the error number
- * @info: extra information string
- *
- * Handle an error at the connection level
- */
-static void
-virLibNetworkError(virNetworkPtr network, virErrorNumber error,
-                   const char *info)
-{
-    virConnectPtr conn = NULL;
-    const char *errmsg;
-
-    if (error == VIR_ERR_OK)
-        return;
-
-    errmsg = virErrorMsg(error, info);
-    if (error != VIR_ERR_INVALID_NETWORK) {
-        conn = network->conn;
-    }
-    virRaiseError(conn, NULL, network, VIR_FROM_NET, error, VIR_ERR_ERROR,
-                  errmsg, info, NULL, 0, 0, errmsg, info);
-}
-
-/**
- * virLibInterfaceError:
- * @conn: the connection if available
- * @error: the error number
- * @info: extra information string
- *
- * Handle an error at the connection level
- */
-static void
-virLibInterfaceError(virInterfacePtr iface, virErrorNumber error,
-                   const char *info)
-{
-    virConnectPtr conn = NULL;
-    const char *errmsg;
-
-    if (error == VIR_ERR_OK)
-        return;
-
-    errmsg = virErrorMsg(error, info);
-    if (error != VIR_ERR_INVALID_INTERFACE) {
-        conn = iface->conn;
-    }
-    virRaiseError(conn, NULL, NULL, VIR_FROM_INTERFACE, error, VIR_ERR_ERROR,
-                  errmsg, info, NULL, 0, 0, errmsg, info);
-}
-
-/**
- * virLibStoragePoolError:
- * @conn: the connection if available
- * @error: the error number
- * @info: extra information string
- *
- * Handle an error at the connection level
- */
-static void
-virLibStoragePoolError(virStoragePoolPtr pool, virErrorNumber error,
-                       const char *info)
-{
-    virConnectPtr conn = NULL;
-    const char *errmsg;
-
-    if (error == VIR_ERR_OK)
-        return;
-
-    errmsg = virErrorMsg(error, info);
-    if (error != VIR_ERR_INVALID_STORAGE_POOL)
-        conn = pool->conn;
-
-    virRaiseError(conn, NULL, NULL, VIR_FROM_STORAGE, error, VIR_ERR_ERROR,
-                  errmsg, info, NULL, 0, 0, errmsg, info);
-}
-
-/**
- * virLibStorageVolError:
- * @conn: the connection if available
- * @error: the error number
- * @info: extra information string
- *
- * Handle an error at the connection level
- */
-static void
-virLibStorageVolError(virStorageVolPtr vol, virErrorNumber error,
-                      const char *info)
-{
-    virConnectPtr conn = NULL;
-    const char *errmsg;
-
-    if (error == VIR_ERR_OK)
-        return;
-
-    errmsg = virErrorMsg(error, info);
-    if (error != VIR_ERR_INVALID_STORAGE_VOL)
-        conn = vol->conn;
-
-    virRaiseError(conn, NULL, NULL, VIR_FROM_STORAGE, error, VIR_ERR_ERROR,
-                  errmsg, info, NULL, 0, 0, errmsg, info);
-}
-
-/**
- * virLibNodeDeviceError:
- * @dev: the device if available
- * @error: the error number
- * @info: extra information string
- *
- * Handle an error at the node device level
- */
-static void
-virLibNodeDeviceError(virNodeDevicePtr dev, virErrorNumber error,
-                      const char *info)
-{
-    virConnectPtr conn = NULL;
-    const char *errmsg;
-
-    if (error == VIR_ERR_OK)
-        return;
-
-    errmsg = virErrorMsg(error, info);
-    if (error != VIR_ERR_INVALID_NODE_DEVICE)
-        conn = dev->conn;
-
-    virRaiseError(conn, NULL, NULL, VIR_FROM_NODEDEV, error, VIR_ERR_ERROR,
-                    errmsg, info, NULL, 0, 0, errmsg, info);
-}
-
-#define virLibStreamError(conn, code, ...)                      \
-    virReportErrorHelper(conn, VIR_FROM_NONE, code, __FILE__,   \
+#define virLibConnError(code, ...)                                \
+    virReportErrorHelper(NULL, VIR_FROM_NONE, code, __FILE__,     \
+                         __FUNCTION__, __LINE__, __VA_ARGS__)
+#define virLibDomainError(code, ...)                              \
+    virReportErrorHelper(NULL, VIR_FROM_DOM, code, __FILE__,      \
+                         __FUNCTION__, __LINE__, __VA_ARGS__)
+#define virLibNetworkError(code, ...)                             \
+    virReportErrorHelper(NULL, VIR_FROM_NETWORK, code, __FILE__,  \
+                         __FUNCTION__, __LINE__, __VA_ARGS__)
+#define virLibStoragePoolError(code, ...)                         \
+    virReportErrorHelper(NULL, VIR_FROM_STORAGE, code, __FILE__,  \
+                         __FUNCTION__, __LINE__, __VA_ARGS__)
+#define virLibStorageVolError(code, ...)                          \
+    virReportErrorHelper(NULL, VIR_FROM_STORAGE, code, __FILE__,  \
+                         __FUNCTION__, __LINE__, __VA_ARGS__)
+#define virLibInterfaceError(code, ...)                           \
+    virReportErrorHelper(NULL, VIR_FROM_INTERFACE, code, __FILE__,\
+                         __FUNCTION__, __LINE__, __VA_ARGS__)
+#define virLibNodeDeviceError(code, ...)                          \
+    virReportErrorHelper(NULL, VIR_FROM_NODEDEV, code, __FILE__,  \
+                         __FUNCTION__, __LINE__, __VA_ARGS__)
+#define virLibSecretError(code, ...)                              \
+    virReportErrorHelper(NULL, VIR_FROM_SECRET, code, __FILE__,   \
+                         __FUNCTION__, __LINE__, __VA_ARGS__)
+#define virLibStreamError(code, ...)                              \
+    virReportErrorHelper(NULL, VIR_FROM_STREAMS, code, __FILE__,  \
+                         __FUNCTION__, __LINE__, __VA_ARGS__)
+#define virLibNWFilterError(code, ...)                            \
+    virReportErrorHelper(NULL, VIR_FROM_NWFILTER, code, __FILE__, \
+                         __FUNCTION__, __LINE__, __VA_ARGS__)
+#define virLibDomainSnapshotError(code, ...)                            \
+    virReportErrorHelper(NULL, VIR_FROM_DOMAIN_SNAPSHOT, code, __FILE__, \
                          __FUNCTION__, __LINE__, __VA_ARGS__)
 
-/**
- * virLibSecretError:
- * @secret: the secret if available
- * @error: the error number
- * @info: extra information string
- *
- * Handle an error at the secret level
- */
-static void
-virLibSecretError(virSecretPtr secret, virErrorNumber error, const char *info)
-{
-    virConnectPtr conn = NULL;
-    const char *errmsg;
-
-    if (error == VIR_ERR_OK)
-        return;
-
-    errmsg = virErrorMsg(error, info);
-    if (error != VIR_ERR_INVALID_SECRET)
-        conn = secret->conn;
-
-    virRaiseError(conn, NULL, NULL, VIR_FROM_SECRET, error, VIR_ERR_ERROR,
-                  errmsg, info, NULL, 0, 0, errmsg, info);
-}
-
-/**
- * virLibNWFilterError:
- * @conn: the connection if available
- * @error: the error number
- * @info: extra information string
- *
- * Handle an error at the connection level
- */
-static void
-virLibNWFilterError(virNWFilterPtr pool, virErrorNumber error,
-                    const char *info)
-{
-    virConnectPtr conn = NULL;
-    const char *errmsg;
-
-    if (error == VIR_ERR_OK)
-        return;
-
-    errmsg = virErrorMsg(error, info);
-    if (error != VIR_ERR_INVALID_NWFILTER)
-        conn = pool->conn;
-
-    virRaiseError(conn, NULL, NULL, VIR_FROM_NWFILTER, error, VIR_ERR_ERROR,
-                  errmsg, info, NULL, 0, 0, errmsg, info);
-}
-
-/**
- * virLibDomainSnapshotError:
- * @snapshot: the snapshot if available
- * @error: the error number
- * @info: extra information string
- *
- * Handle an error at the domain snapshot level
- */
-static void
-virLibDomainSnapshotError(virDomainSnapshotPtr snapshot, virErrorNumber error, const char *info)
-{
-    virConnectPtr conn = NULL;
-    const char *errmsg;
-
-    if (error == VIR_ERR_OK)
-        return;
-
-    errmsg = virErrorMsg(error, info);
-    if (error != VIR_ERR_INVALID_DOMAIN_SNAPSHOT)
-        conn = snapshot->domain->conn;
-
-    virRaiseError(conn, NULL, NULL, VIR_FROM_DOMAIN_SNAPSHOT, error, VIR_ERR_ERROR,
-                  errmsg, info, NULL, 0, 0, errmsg, info);
-}
 
 /**
  * virRegisterNetworkDriver:
@@ -762,12 +518,12 @@ virRegisterNetworkDriver(virNetworkDriverPtr driver)
       return -1;
 
     if (driver == NULL) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         return(-1);
     }
 
     if (virNetworkDriverTabCount >= MAX_DRIVERS) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         return(-1);
     }
 
@@ -793,12 +549,12 @@ virRegisterInterfaceDriver(virInterfaceDriverPtr driver)
       return -1;
 
     if (driver == NULL) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         return(-1);
     }
 
     if (virInterfaceDriverTabCount >= MAX_DRIVERS) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         return(-1);
     }
 
@@ -824,12 +580,12 @@ virRegisterStorageDriver(virStorageDriverPtr driver)
       return -1;
 
     if (driver == NULL) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         return(-1);
     }
 
     if (virStorageDriverTabCount >= MAX_DRIVERS) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         return(-1);
     }
 
@@ -855,12 +611,12 @@ virRegisterDeviceMonitor(virDeviceMonitorPtr driver)
       return -1;
 
     if (driver == NULL) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         return(-1);
     }
 
     if (virDeviceMonitorTabCount >= MAX_DRIVERS) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         return(-1);
     }
 
@@ -886,12 +642,12 @@ virRegisterSecretDriver(virSecretDriverPtr driver)
       return -1;
 
     if (driver == NULL) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         return(-1);
     }
 
     if (virSecretDriverTabCount >= MAX_DRIVERS) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         return(-1);
     }
 
@@ -917,12 +673,12 @@ virRegisterNWFilterDriver(virNWFilterDriverPtr driver)
       return -1;
 
     if (driver == NULL) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         return -1;
     }
 
     if (virNWFilterDriverTabCount >= MAX_DRIVERS) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         return -1;
     }
 
@@ -945,23 +701,24 @@ virRegisterNWFilterDriver(virNWFilterDriverPtr driver)
 int
 virRegisterDriver(virDriverPtr driver)
 {
+    DEBUG("driver=%p name=%s", driver, driver ? NULLSTR(driver->name) : "(null)");
+
     if (virInitialize() < 0)
-      return -1;
+        return -1;
 
     if (driver == NULL) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         return(-1);
     }
 
     if (virDriverTabCount >= MAX_DRIVERS) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         return(-1);
     }
 
     if (driver->no < 0) {
-        virLibConnError
-            (NULL, VIR_ERR_INVALID_ARG,
-             "virRegisterDriver: tried to register an internal Xen driver");
+        virLibConnError(VIR_ERR_INVALID_ARG,
+                        _("Tried to register an internal Xen driver"));
         return -1;
     }
 
@@ -988,12 +745,12 @@ virRegisterStateDriver(virStateDriverPtr driver)
       return -1;
 
     if (driver == NULL) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         return(-1);
     }
 
     if (virStateDriverTabCount >= MAX_DRIVERS) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         return(-1);
     }
 
@@ -1176,7 +933,7 @@ virGetVersion(unsigned long *libVer, const char *type,
             *typeVer = remoteVersion();
 # endif
         if (*typeVer == 0) {
-            virLibConnError(NULL, VIR_ERR_NO_SUPPORT, type);
+            virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
             goto error;
         }
 #endif /* WITH_DRIVER_MODULES */
@@ -1230,8 +987,8 @@ do_open (const char *name,
 
         ret->uri = xmlParseURI (name);
         if (!ret->uri) {
-            virLibConnError (ret, VIR_ERR_INVALID_ARG,
-                             _("could not parse connection URI"));
+            virLibConnError(VIR_ERR_INVALID_ARG,
+                            _("could not parse connection URI"));
             goto failed;
         }
 
@@ -1302,7 +1059,7 @@ do_open (const char *name,
 
     if (!ret->driver) {
         /* If we reach here, then all drivers declined the connection. */
-        virLibConnError (NULL, VIR_ERR_NO_CONNECT, name);
+        virLibConnError(VIR_ERR_NO_CONNECT, "No connection for URI %s", NULLSTR(name));
         goto failed;
     }
 
@@ -1314,10 +1071,6 @@ do_open (const char *name,
               (res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
                (res == VIR_DRV_OPEN_ERROR ? "ERROR" : "unknown status")));
         if (res == VIR_DRV_OPEN_ERROR) {
-            if (STREQ(virNetworkDriverTab[i]->name, "remote")) {
-                virLibConnWarning (NULL, VIR_WAR_NO_NETWORK,
-                                   "Is the daemon running ?");
-            }
             break;
         } else if (res == VIR_DRV_OPEN_SUCCESS) {
             ret->networkDriver = virNetworkDriverTab[i];
@@ -1333,10 +1086,6 @@ do_open (const char *name,
               (res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
                (res == VIR_DRV_OPEN_ERROR ? "ERROR" : "unknown status")));
         if (res == VIR_DRV_OPEN_ERROR) {
-            if (STREQ(virInterfaceDriverTab[i]->name, "remote")) {
-                virLibConnWarning (NULL, VIR_WAR_NO_INTERFACE,
-                                   "Is the daemon running ?");
-            }
             break;
         } else if (res == VIR_DRV_OPEN_SUCCESS) {
             ret->interfaceDriver = virInterfaceDriverTab[i];
@@ -1353,10 +1102,6 @@ do_open (const char *name,
               (res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
                (res == VIR_DRV_OPEN_ERROR ? "ERROR" : "unknown status")));
         if (res == VIR_DRV_OPEN_ERROR) {
-            if (STREQ(virStorageDriverTab[i]->name, "remote")) {
-                virLibConnWarning (NULL, VIR_WAR_NO_STORAGE,
-                                   "Is the daemon running ?");
-            }
             break;
          } else if (res == VIR_DRV_OPEN_SUCCESS) {
             ret->storageDriver = virStorageDriverTab[i];
@@ -1373,17 +1118,6 @@ do_open (const char *name,
               (res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
                (res == VIR_DRV_OPEN_ERROR ? "ERROR" : "unknown status")));
         if (res == VIR_DRV_OPEN_ERROR) {
-            if (STREQ(virDeviceMonitorTab[i]->name, "remote")) {
-                virLibConnWarning (NULL, VIR_WAR_NO_NODE,
-                                   "Is the libvirtd daemon running ?");
-            } else {
-                char *msg;
-                if (virAsprintf(&msg, "Is the %s daemon running?",
-                                virDeviceMonitorTab[i]->name) > 0) {
-                    virLibConnWarning (NULL, VIR_WAR_NO_NODE, msg);
-                    VIR_FREE(msg);
-                }
-            }
             break;
         } else if (res == VIR_DRV_OPEN_SUCCESS) {
             ret->deviceMonitor = virDeviceMonitorTab[i];
@@ -1400,10 +1134,6 @@ do_open (const char *name,
               (res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
                (res == VIR_DRV_OPEN_ERROR ? "ERROR" : "unknown status")));
         if (res == VIR_DRV_OPEN_ERROR) {
-            if (STREQ(virSecretDriverTab[i]->name, "remote")) {
-                virLibConnWarning (NULL, VIR_WAR_NO_SECRET,
-                                   "Is the daemon running ?");
-            }
             break;
          } else if (res == VIR_DRV_OPEN_SUCCESS) {
             ret->secretDriver = virSecretDriverTab[i];
@@ -1420,10 +1150,6 @@ do_open (const char *name,
               (res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
                (res == VIR_DRV_OPEN_ERROR ? "ERROR" : "unknown status")));
         if (res == VIR_DRV_OPEN_ERROR) {
-            if (STREQ(virNWFilterDriverTab[i]->name, "remote")) {
-                virLibConnWarning (NULL, VIR_WAR_NO_NWFILTER,
-                                   _("Is the daemon running ?"));
-            }
             break;
          } else if (res == VIR_DRV_OPEN_SUCCESS) {
             ret->nwfilterDriver = virNWFilterDriverTab[i];
@@ -1572,7 +1298,7 @@ virConnectClose(virConnectPtr conn)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         goto error;
     }
 
@@ -1607,7 +1333,7 @@ int
 virConnectRef(virConnectPtr conn)
 {
     if ((!VIR_IS_CONNECT(conn))) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         virDispatchError(NULL);
         return(-1);
     }
@@ -1631,7 +1357,7 @@ virDrvSupportsFeature (virConnectPtr conn, int feature)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -1667,7 +1393,7 @@ virConnectGetType(virConnectPtr conn)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
@@ -1700,13 +1426,13 @@ virConnectGetVersion(virConnectPtr conn, unsigned long *hvVer)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
 
     if (hvVer == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -1717,7 +1443,7 @@ virConnectGetVersion(virConnectPtr conn, unsigned long *hvVer)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -1744,13 +1470,13 @@ virConnectGetLibVersion(virConnectPtr conn, unsigned long *libVer)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
 
     if (libVer == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -1789,7 +1515,7 @@ virConnectGetHostname (virConnectPtr conn)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
@@ -1801,7 +1527,7 @@ virConnectGetHostname (virConnectPtr conn)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -1832,7 +1558,7 @@ virConnectGetURI (virConnectPtr conn)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
@@ -1869,7 +1595,7 @@ virConnectGetMaxVcpus(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
@@ -1881,7 +1607,7 @@ virConnectGetMaxVcpus(virConnectPtr conn,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(conn);
     return -1;
@@ -1905,13 +1631,13 @@ virConnectListDomains(virConnectPtr conn, int *ids, int maxids)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
 
     if ((ids == NULL) || (maxids < 0)) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -1922,7 +1648,7 @@ virConnectListDomains(virConnectPtr conn, int *ids, int maxids)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(conn);
     return -1;
@@ -1944,7 +1670,7 @@ virConnectNumOfDomains(virConnectPtr conn)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
@@ -1956,7 +1682,7 @@ virConnectNumOfDomains(virConnectPtr conn)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(conn);
     return -1;
@@ -1984,7 +1710,7 @@ virDomainGetConnect (virDomainPtr dom)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN (dom)) {
-        virLibDomainError (NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
@@ -2015,16 +1741,16 @@ virDomainCreateXML(virConnectPtr conn, const char *xmlDesc,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (xmlDesc == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -2036,7 +1762,7 @@ virDomainCreateXML(virConnectPtr conn, const char *xmlDesc,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(conn);
     return NULL;
@@ -2081,12 +1807,12 @@ virDomainLookupByID(virConnectPtr conn, int id)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (id < 0) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -2098,7 +1824,7 @@ virDomainLookupByID(virConnectPtr conn, int id)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -2126,12 +1852,12 @@ virDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (uuid == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -2143,7 +1869,7 @@ virDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -2169,17 +1895,17 @@ virDomainLookupByUUIDString(virConnectPtr conn, const char *uuidstr)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (uuidstr == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
     if (virUUIDParse(uuidstr, uuid) < 0) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -2208,12 +1934,12 @@ virDomainLookupByName(virConnectPtr conn, const char *name)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (name == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -2225,7 +1951,7 @@ virDomainLookupByName(virConnectPtr conn, const char *name)
         return dom;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -2253,14 +1979,14 @@ virDomainDestroy(virDomainPtr domain)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     conn = domain->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -2272,7 +1998,7 @@ virDomainDestroy(virDomainPtr domain)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -2296,7 +2022,7 @@ virDomainFree(virDomainPtr domain)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -2328,7 +2054,7 @@ int
 virDomainRef(virDomainPtr domain)
 {
     if ((!VIR_IS_CONNECTED_DOMAIN(domain))) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         virDispatchError(NULL);
         return(-1);
     }
@@ -2362,12 +2088,12 @@ virDomainSuspend(virDomainPtr domain)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -2381,7 +2107,7 @@ virDomainSuspend(virDomainPtr domain)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -2408,12 +2134,12 @@ virDomainResume(virDomainPtr domain)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -2427,7 +2153,7 @@ virDomainResume(virDomainPtr domain)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -2457,17 +2183,17 @@ virDomainSave(virDomainPtr domain, const char *to)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
     conn = domain->conn;
     if (to == NULL) {
-        virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -2499,7 +2225,7 @@ virDomainSave(virDomainPtr domain, const char *to)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -2524,16 +2250,16 @@ virDomainRestore(virConnectPtr conn, const char *from)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
     if (from == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -2546,14 +2272,14 @@ virDomainRestore(virConnectPtr conn, const char *from)
 
         t = strlen(from);
         if (getcwd(filepath, sizeof(filepath) - (t + 3)) == NULL) {
-            virLibConnError(conn, VIR_ERR_SYSTEM_ERROR,
+            virLibConnError(VIR_ERR_SYSTEM_ERROR,
                             _("cannot get working directory"));
             goto error;
         }
         len = strlen(filepath);
         /* that should be covered by getcwd() semantic, but be 100% sure */
         if (len > sizeof(filepath) - (t + 3)) {
-            virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
+            virLibConnError(VIR_ERR_INTERNAL_ERROR,
                             _("path too long"));
             goto error;
         }
@@ -2570,7 +2296,7 @@ virDomainRestore(virConnectPtr conn, const char *from)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -2600,17 +2326,17 @@ virDomainCoreDump(virDomainPtr domain, const char *to, int flags)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
     conn = domain->conn;
     if (to == NULL) {
-        virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -2623,14 +2349,14 @@ virDomainCoreDump(virDomainPtr domain, const char *to, int flags)
 
         t = strlen(to);
         if (getcwd(filepath, sizeof(filepath) - (t + 3)) == NULL) {
-            virLibDomainError(domain, VIR_ERR_SYSTEM_ERROR,
+            virLibDomainError(VIR_ERR_SYSTEM_ERROR,
                               _("cannot get current directory"));
             goto error;
         }
         len = strlen(filepath);
         /* that should be covered by getcwd() semantic, but be 100% sure */
         if (len > sizeof(filepath) - (t + 3)) {
-            virLibDomainError(domain, VIR_ERR_INTERNAL_ERROR,
+            virLibDomainError(VIR_ERR_INTERNAL_ERROR,
                               _("path too long"));
             goto error;
         }
@@ -2648,7 +2374,7 @@ virDomainCoreDump(virDomainPtr domain, const char *to, int flags)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -2678,12 +2404,12 @@ virDomainShutdown(virDomainPtr domain)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -2697,7 +2423,7 @@ virDomainShutdown(virDomainPtr domain)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -2725,12 +2451,12 @@ virDomainReboot(virDomainPtr domain, unsigned int flags)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -2744,7 +2470,7 @@ virDomainReboot(virDomainPtr domain, unsigned int flags)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -2768,7 +2494,7 @@ virDomainGetName(virDomainPtr domain)
     virResetLastError();
 
     if (!VIR_IS_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
@@ -2792,12 +2518,12 @@ virDomainGetUUID(virDomainPtr domain, unsigned char *uuid)
     virResetLastError();
 
     if (!VIR_IS_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (uuid == NULL) {
-        virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         virDispatchError(domain->conn);
         return (-1);
     }
@@ -2827,12 +2553,12 @@ virDomainGetUUIDString(virDomainPtr domain, char *buf)
     virResetLastError();
 
     if (!VIR_IS_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (buf == NULL) {
-        virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -2863,7 +2589,7 @@ virDomainGetID(virDomainPtr domain)
     virResetLastError();
 
     if (!VIR_IS_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return ((unsigned int) -1);
     }
@@ -2889,7 +2615,7 @@ virDomainGetOSType(virDomainPtr domain)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
@@ -2904,7 +2630,7 @@ virDomainGetOSType(virDomainPtr domain)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -2931,7 +2657,7 @@ virDomainGetMaxMemory(virDomainPtr domain)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (0);
     }
@@ -2946,7 +2672,7 @@ virDomainGetMaxMemory(virDomainPtr domain)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -2978,16 +2704,16 @@ virDomainSetMaxMemory(virDomainPtr domain, unsigned long memory)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
     if (memory < 4096) {
-        virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
     conn = domain->conn;
@@ -3000,7 +2726,7 @@ virDomainSetMaxMemory(virDomainPtr domain, unsigned long memory)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -3032,16 +2758,16 @@ virDomainSetMemory(virDomainPtr domain, unsigned long memory)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
     if (memory < 4096) {
-        virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -3055,7 +2781,7 @@ virDomainSetMemory(virDomainPtr domain, unsigned long memory)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -3088,16 +2814,16 @@ virDomainSetMemoryParameters(virDomainPtr domain,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
     if ((nparams <= 0) || (params == NULL)) {
-        virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
     conn = domain->conn;
@@ -3110,7 +2836,7 @@ virDomainSetMemoryParameters(virDomainPtr domain,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -3164,12 +2890,12 @@ virDomainGetMemoryParameters(virDomainPtr domain,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
     if ((nparams == NULL) || (*nparams < 0)) {
-        virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
     conn = domain->conn;
@@ -3181,7 +2907,7 @@ virDomainGetMemoryParameters(virDomainPtr domain,
             goto error;
         return ret;
     }
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -3209,12 +2935,12 @@ virDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (info == NULL) {
-        virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -3230,7 +2956,7 @@ virDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -3258,7 +2984,7 @@ virDomainGetXMLDesc(virDomainPtr domain, int flags)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
@@ -3266,7 +2992,7 @@ virDomainGetXMLDesc(virDomainPtr domain, int flags)
     conn = domain->conn;
 
     if ((conn->flags & VIR_CONNECT_RO) && (flags & VIR_DOMAIN_XML_SECURE)) {
-        virLibConnError(conn, VIR_ERR_OPERATION_DENIED,
+        virLibConnError(VIR_ERR_OPERATION_DENIED,
                         _("virDomainGetXMLDesc with secure flag"));
         goto error;
     }
@@ -3281,7 +3007,7 @@ virDomainGetXMLDesc(virDomainPtr domain, int flags)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -3312,13 +3038,13 @@ char *virConnectDomainXMLFromNative(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
 
     if (nativeFormat == NULL || nativeConfig == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -3333,7 +3059,7 @@ char *virConnectDomainXMLFromNative(virConnectPtr conn,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -3364,13 +3090,13 @@ char *virConnectDomainXMLToNative(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
 
     if (nativeFormat == NULL || domainXml == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -3385,7 +3111,7 @@ char *virConnectDomainXMLToNative(virConnectPtr conn,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -3429,7 +3155,7 @@ virDomainMigrateVersion1 (virDomainPtr domain,
         goto done;
 
     if (uri == NULL && uri_out == NULL) {
-        virLibConnError (domain->conn, VIR_ERR_INTERNAL_ERROR,
+        virLibConnError(VIR_ERR_INTERNAL_ERROR,
                          _("domainMigratePrepare did not set uri"));
         goto done;
     }
@@ -3495,7 +3221,7 @@ virDomainMigrateVersion2 (virDomainPtr domain,
      * and pass it to Prepare2.
      */
     if (!domain->conn->driver->domainDumpXML) {
-        virLibConnError (domain->conn, VIR_ERR_INTERNAL_ERROR, __FUNCTION__);
+        virLibConnError(VIR_ERR_INTERNAL_ERROR, __FUNCTION__);
         virDispatchError(domain->conn);
         return NULL;
     }
@@ -3518,7 +3244,7 @@ virDomainMigrateVersion2 (virDomainPtr domain,
         goto done;
 
     if (uri == NULL && uri_out == NULL) {
-        virLibConnError (domain->conn, VIR_ERR_INTERNAL_ERROR,
+        virLibConnError(VIR_ERR_INTERNAL_ERROR,
                          _("domainMigratePrepare2 did not set uri"));
         virDispatchError(domain->conn);
         goto done;
@@ -3574,20 +3300,20 @@ virDomainMigratePeer2Peer (virDomainPtr domain,
     xmlURIPtr tempuri = NULL;
 
     if (!domain->conn->driver->domainMigratePerform) {
-        virLibConnError (domain->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+        virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
         virDispatchError(domain->conn);
         return -1;
     }
 
     tempuri = xmlParseURI(uri);
     if (!tempuri) {
-        virLibConnError (domain->conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         virDispatchError(domain->conn);
         return -1;
     }
 
     if (!tempuri->server || STRPREFIX(tempuri->server, "localhost")) {
-        virLibConnError(domain->conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         virDispatchError(domain->conn);
         xmlFreeURI(tempuri);
         return -1;
@@ -3625,7 +3351,7 @@ virDomainMigrateDirect (virDomainPtr domain,
                         unsigned long bandwidth)
 {
     if (!domain->conn->driver->domainMigratePerform) {
-        virLibConnError (domain->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+        virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
         virDispatchError(domain->conn);
         return -1;
     }
@@ -3725,23 +3451,23 @@ virDomainMigrate (virDomainPtr domain,
 
     /* First checkout the source */
     if (!VIR_IS_CONNECTED_DOMAIN (domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
     /* Now checkout the destination */
     if (!VIR_IS_CONNECT(dconn)) {
-        virLibConnError(domain->conn, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         goto error;
     }
     if (dconn->flags & VIR_CONNECT_RO) {
         /* NB, deliberately report error against source object, not dest */
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -3764,12 +3490,12 @@ virDomainMigrate (virDomainPtr domain,
             ddomain = virDomainLookupByName (dconn, dname ? dname : domain->name);
         } else {
             /* This driver does not support peer to peer migration */
-            virLibConnError (domain->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+            virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
             goto error;
         }
     } else {
         if (flags & VIR_MIGRATE_TUNNELLED) {
-            virLibConnError(domain->conn, VIR_ERR_OPERATION_INVALID,
+            virLibConnError(VIR_ERR_OPERATION_INVALID,
                             _("cannot perform tunnelled migration without using peer2peer flag"));
             goto error;
         }
@@ -3787,7 +3513,7 @@ virDomainMigrate (virDomainPtr domain,
             ddomain = virDomainMigrateVersion2(domain, dconn, flags, dname, uri, bandwidth);
         else {
             /* This driver does not support any migration method */
-            virLibConnError(domain->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+            virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
             goto error;
         }
     }
@@ -3874,17 +3600,17 @@ virDomainMigrateToURI (virDomainPtr domain,
 
     /* First checkout the source */
     if (!VIR_IS_CONNECTED_DOMAIN (domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
     if (duri == NULL) {
-        virLibConnError (domain->conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -3895,7 +3621,7 @@ virDomainMigrateToURI (virDomainPtr domain,
                 goto error;
         } else {
             /* No peer to peer migration supported */
-            virLibConnError (domain->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+            virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
             goto error;
         }
     } else {
@@ -3905,7 +3631,7 @@ virDomainMigrateToURI (virDomainPtr domain,
                 goto error;
         } else {
             /* Cannot do a migration with only the perform step */
-            virLibConnError (domain->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+            virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
             goto error;
         }
     }
@@ -3939,13 +3665,13 @@ virDomainMigratePrepare (virConnectPtr dconn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT (dconn)) {
-        virLibConnError (NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
 
     if (dconn->flags & VIR_CONNECT_RO) {
-        virLibConnError(dconn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -3959,7 +3685,7 @@ virDomainMigratePrepare (virConnectPtr dconn,
         return ret;
     }
 
-    virLibConnError (dconn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(dconn);
@@ -3988,14 +3714,14 @@ virDomainMigratePerform (virDomainPtr domain,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN (domain)) {
-        virLibDomainError (NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
     conn = domain->conn;
 
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -4009,7 +3735,7 @@ virDomainMigratePerform (virDomainPtr domain,
         return ret;
     }
 
-    virLibDomainError (domain, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibDomainError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -4035,13 +3761,13 @@ virDomainMigrateFinish (virConnectPtr dconn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT (dconn)) {
-        virLibConnError (NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
 
     if (dconn->flags & VIR_CONNECT_RO) {
-        virLibConnError(dconn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -4055,7 +3781,7 @@ virDomainMigrateFinish (virConnectPtr dconn,
         return ret;
     }
 
-    virLibConnError (dconn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(dconn);
@@ -4086,13 +3812,13 @@ virDomainMigratePrepare2 (virConnectPtr dconn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT (dconn)) {
-        virLibConnError (NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
 
     if (dconn->flags & VIR_CONNECT_RO) {
-        virLibConnError(dconn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -4107,7 +3833,7 @@ virDomainMigratePrepare2 (virConnectPtr dconn,
         return ret;
     }
 
-    virLibConnError (dconn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(dconn);
@@ -4134,13 +3860,13 @@ virDomainMigrateFinish2 (virConnectPtr dconn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT (dconn)) {
-        virLibConnError (NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
 
     if (dconn->flags & VIR_CONNECT_RO) {
-        virLibConnError(dconn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -4155,7 +3881,7 @@ virDomainMigrateFinish2 (virConnectPtr dconn,
         return ret;
     }
 
-    virLibConnError (dconn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(dconn);
@@ -4183,18 +3909,18 @@ virDomainMigratePrepareTunnel(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
 
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
     if (conn != st->conn) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -4207,7 +3933,7 @@ virDomainMigratePrepareTunnel(virConnectPtr conn,
         return rv;
     }
 
-    virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -4232,12 +3958,12 @@ virNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (info == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -4249,7 +3975,7 @@ virNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -4274,7 +4000,7 @@ virConnectGetCapabilities (virConnectPtr conn)
     virResetLastError();
 
     if (!VIR_IS_CONNECT (conn)) {
-        virLibConnError (NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
@@ -4288,7 +4014,7 @@ virConnectGetCapabilities (virConnectPtr conn)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -4313,7 +4039,7 @@ virNodeGetFreeMemory(virConnectPtr conn)
     virResetLastError();
 
     if (!VIR_IS_CONNECT (conn)) {
-        virLibConnError (NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return 0;
     }
@@ -4326,7 +4052,7 @@ virNodeGetFreeMemory(virConnectPtr conn)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -4353,7 +4079,7 @@ virDomainGetSchedulerType(virDomainPtr domain, int *nparams)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
@@ -4366,7 +4092,7 @@ virDomainGetSchedulerType(virDomainPtr domain, int *nparams)
         return schedtype;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -4399,7 +4125,7 @@ virDomainGetSchedulerParameters(virDomainPtr domain,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
@@ -4413,7 +4139,7 @@ virDomainGetSchedulerParameters(virDomainPtr domain,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -4443,12 +4169,12 @@ virDomainSetSchedulerParameters(virDomainPtr domain,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
     conn = domain->conn;
@@ -4461,7 +4187,7 @@ virDomainSetSchedulerParameters(virDomainPtr domain,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -4504,12 +4230,12 @@ virDomainBlockStats (virDomainPtr dom, const char *path,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN (dom)) {
-        virLibDomainError (NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
     if (!path || !stats || size > sizeof stats2) {
-        virLibDomainError (dom, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
     conn = dom->conn;
@@ -4522,7 +4248,7 @@ virDomainBlockStats (virDomainPtr dom, const char *path,
         return 0;
     }
 
-    virLibDomainError (dom, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibDomainError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(dom->conn);
@@ -4564,12 +4290,12 @@ virDomainInterfaceStats (virDomainPtr dom, const char *path,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN (dom)) {
-        virLibDomainError (NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
     if (!path || !stats || size > sizeof stats2) {
-        virLibDomainError (dom, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
     conn = dom->conn;
@@ -4582,7 +4308,7 @@ virDomainInterfaceStats (virDomainPtr dom, const char *path,
         return 0;
     }
 
-    virLibDomainError (dom, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibDomainError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(dom->conn);
@@ -4628,7 +4354,7 @@ int virDomainMemoryStats (virDomainPtr dom, virDomainMemoryStatPtr stats,
     VIR_DOMAIN_DEBUG(dom, "stats=%p, nr_stats=%u", stats, nr_stats);
 
     if (flags != 0) {
-        virLibDomainError (dom, VIR_ERR_INVALID_ARG,
+        virLibDomainError(VIR_ERR_INVALID_ARG,
                            _("flags must be zero"));
         goto error;
     }
@@ -4636,7 +4362,7 @@ int virDomainMemoryStats (virDomainPtr dom, virDomainMemoryStatPtr stats,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN (dom)) {
-        virLibDomainError (NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
@@ -4654,7 +4380,7 @@ int virDomainMemoryStats (virDomainPtr dom, virDomainMemoryStatPtr stats,
         return nr_stats_ret;
     }
 
-    virLibDomainError (dom, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibDomainError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(dom->conn);
@@ -4716,32 +4442,32 @@ virDomainBlockPeek (virDomainPtr dom,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN (dom)) {
-        virLibDomainError (NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
     conn = dom->conn;
 
     if (dom->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(dom, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
     if (!path) {
-        virLibDomainError (dom, VIR_ERR_INVALID_ARG,
+        virLibDomainError(VIR_ERR_INVALID_ARG,
                            _("path is NULL"));
         goto error;
     }
 
     if (flags != 0) {
-        virLibDomainError (dom, VIR_ERR_INVALID_ARG,
+        virLibDomainError(VIR_ERR_INVALID_ARG,
                            _("flags must be zero"));
         goto error;
     }
 
     /* Allow size == 0 as an access test. */
     if (size > 0 && !buffer) {
-        virLibDomainError (dom, VIR_ERR_INVALID_ARG,
+        virLibDomainError(VIR_ERR_INVALID_ARG,
                            _("buffer is NULL"));
         goto error;
     }
@@ -4755,7 +4481,7 @@ virDomainBlockPeek (virDomainPtr dom,
         return ret;
     }
 
-    virLibDomainError (dom, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibDomainError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(dom->conn);
@@ -4808,14 +4534,14 @@ virDomainMemoryPeek (virDomainPtr dom,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN (dom)) {
-        virLibDomainError (NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
     conn = dom->conn;
 
     if (dom->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(dom, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -4843,14 +4569,14 @@ virDomainMemoryPeek (virDomainPtr dom,
      */
 
     if (flags != VIR_MEMORY_VIRTUAL && flags != VIR_MEMORY_PHYSICAL) {
-        virLibDomainError (dom, VIR_ERR_INVALID_ARG,
+        virLibDomainError(VIR_ERR_INVALID_ARG,
                      _("flags parameter must be VIR_MEMORY_VIRTUAL or VIR_MEMORY_PHYSICAL"));
         goto error;
     }
 
     /* Allow size == 0 as an access test. */
     if (size > 0 && !buffer) {
-        virLibDomainError (dom, VIR_ERR_INVALID_ARG,
+        virLibDomainError(VIR_ERR_INVALID_ARG,
                            _("buffer is NULL but size is non-zero"));
         goto error;
     }
@@ -4864,7 +4590,7 @@ virDomainMemoryPeek (virDomainPtr dom,
         return ret;
     }
 
-    virLibDomainError (dom, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibDomainError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(dom->conn);
@@ -4893,12 +4619,12 @@ virDomainGetBlockInfo(virDomainPtr domain, const char *path, virDomainBlockInfoP
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (info == NULL) {
-        virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -4914,7 +4640,7 @@ virDomainGetBlockInfo(virDomainPtr domain, const char *path, virDomainBlockInfoP
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -4947,16 +4673,16 @@ virDomainDefineXML(virConnectPtr conn, const char *xml) {
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
     if (xml == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -4968,7 +4694,7 @@ virDomainDefineXML(virConnectPtr conn, const char *xml) {
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -4992,13 +4718,13 @@ virDomainUndefine(virDomainPtr domain) {
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     conn = domain->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -5010,7 +4736,7 @@ virDomainUndefine(virDomainPtr domain) {
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -5033,7 +4759,7 @@ virConnectNumOfDefinedDomains(virConnectPtr conn)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -5046,7 +4772,7 @@ virConnectNumOfDefinedDomains(virConnectPtr conn)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -5072,13 +4798,13 @@ virConnectListDefinedDomains(virConnectPtr conn, char **const names,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     if ((names == NULL) || (maxnames < 0)) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -5090,7 +4816,7 @@ virConnectListDefinedDomains(virConnectPtr conn, char **const names,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -5115,13 +4841,13 @@ virDomainCreate(virDomainPtr domain) {
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     conn = domain->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -5133,7 +4859,7 @@ virDomainCreate(virDomainPtr domain) {
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -5159,13 +4885,13 @@ virDomainCreateWithFlags(virDomainPtr domain, unsigned int flags) {
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     conn = domain->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -5177,7 +4903,7 @@ virDomainCreateWithFlags(virDomainPtr domain, unsigned int flags) {
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -5206,12 +4932,12 @@ virDomainGetAutostart(virDomainPtr domain,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (!autostart) {
-        virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -5225,7 +4951,7 @@ virDomainGetAutostart(virDomainPtr domain,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -5253,7 +4979,7 @@ virDomainSetAutostart(virDomainPtr domain,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -5261,7 +4987,7 @@ virDomainSetAutostart(virDomainPtr domain,
     conn = domain->conn;
 
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -5273,7 +4999,7 @@ virDomainSetAutostart(virDomainPtr domain,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -5308,17 +5034,17 @@ virDomainSetVcpus(virDomainPtr domain, unsigned int nvcpus)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
     if (nvcpus < 1) {
-        virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
     conn = domain->conn;
@@ -5331,7 +5057,7 @@ virDomainSetVcpus(virDomainPtr domain, unsigned int nvcpus)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -5375,19 +5101,19 @@ virDomainSetVcpusFlags(virDomainPtr domain, unsigned int nvcpus,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
     /* Perform some argument validation common to all implementations.  */
     if (nvcpus < 1 || (unsigned short) nvcpus != nvcpus ||
         (flags & (VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_CONFIG)) == 0) {
-        virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
     conn = domain->conn;
@@ -5400,7 +5126,7 @@ virDomainSetVcpusFlags(virDomainPtr domain, unsigned int nvcpus,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -5439,14 +5165,14 @@ virDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     /* Exactly one of these two flags should be set.  */
     if (!(flags & VIR_DOMAIN_VCPU_LIVE) == !(flags & VIR_DOMAIN_VCPU_CONFIG)) {
-        virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
     conn = domain->conn;
@@ -5459,7 +5185,7 @@ virDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -5499,17 +5225,17 @@ virDomainPinVcpu(virDomainPtr domain, unsigned int vcpu,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
     if ((vcpu > 32000) || (cpumap == NULL) || (maplen < 1)) {
-        virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
        goto error;
     }
 
@@ -5523,7 +5249,7 @@ virDomainPinVcpu(virDomainPtr domain, unsigned int vcpu,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -5564,12 +5290,12 @@ virDomainGetVcpus(virDomainPtr domain, virVcpuInfoPtr info, int maxinfo,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if ((info == NULL) || (maxinfo < 1)) {
-        virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -5577,7 +5303,7 @@ virDomainGetVcpus(virDomainPtr domain, virVcpuInfoPtr info, int maxinfo,
        try to memcpy anything into a NULL pointer.  */
     if ((cpumaps == NULL && maplen != 0)
         || (cpumaps && maplen <= 0)) {
-        virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -5592,7 +5318,7 @@ virDomainGetVcpus(virDomainPtr domain, virVcpuInfoPtr info, int maxinfo,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -5621,7 +5347,7 @@ virDomainGetMaxVcpus(virDomainPtr domain)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -5636,7 +5362,7 @@ virDomainGetMaxVcpus(virDomainPtr domain)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -5662,13 +5388,13 @@ virDomainGetSecurityLabel(virDomainPtr domain, virSecurityLabelPtr seclabel)
     VIR_DOMAIN_DEBUG(domain, "seclabel=%p", seclabel);
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
 
     if (seclabel == NULL) {
-        virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -5682,7 +5408,7 @@ virDomainGetSecurityLabel(virDomainPtr domain, virSecurityLabelPtr seclabel)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -5706,13 +5432,13 @@ virNodeGetSecurityModel(virConnectPtr conn, virSecurityModelPtr secmodel)
     DEBUG("conn=%p secmodel=%p", conn, secmodel);
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
 
     if (secmodel == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -5724,7 +5450,7 @@ virNodeGetSecurityModel(virConnectPtr conn, virSecurityModelPtr secmodel)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -5755,12 +5481,12 @@ virDomainAttachDevice(virDomainPtr domain, const char *xml)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
     conn = domain->conn;
@@ -5773,7 +5499,7 @@ virDomainAttachDevice(virDomainPtr domain, const char *xml)
        return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -5815,11 +5541,11 @@ virDomainAttachDeviceFlags(virDomainPtr domain,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         return (-1);
     }
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
     conn = domain->conn;
@@ -5832,7 +5558,7 @@ virDomainAttachDeviceFlags(virDomainPtr domain,
         return ret;
     }
 
-    virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -5859,12 +5585,12 @@ virDomainDetachDevice(virDomainPtr domain, const char *xml)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
     conn = domain->conn;
@@ -5877,7 +5603,7 @@ virDomainDetachDevice(virDomainPtr domain, const char *xml)
          return ret;
      }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -5915,11 +5641,11 @@ virDomainDetachDeviceFlags(virDomainPtr domain,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         return (-1);
     }
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
     conn = domain->conn;
@@ -5932,7 +5658,7 @@ virDomainDetachDeviceFlags(virDomainPtr domain,
         return ret;
     }
 
-    virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -5974,11 +5700,11 @@ virDomainUpdateDeviceFlags(virDomainPtr domain,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         return (-1);
     }
     if (domain->conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
     conn = domain->conn;
@@ -5991,7 +5717,7 @@ virDomainUpdateDeviceFlags(virDomainPtr domain,
         return ret;
     }
 
-    virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -6026,13 +5752,13 @@ virNodeGetCellsFreeMemory(virConnectPtr conn, unsigned long long *freeMems,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     if ((freeMems == NULL) || (maxCells <= 0) || (startCell < 0)) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -6044,7 +5770,7 @@ virNodeGetCellsFreeMemory(virConnectPtr conn, unsigned long long *freeMems,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -6073,7 +5799,7 @@ virNetworkGetConnect (virNetworkPtr net)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NETWORK (net)) {
-        virLibNetworkError (NULL, VIR_ERR_INVALID_NETWORK, __FUNCTION__);
+        virLibNetworkError(VIR_ERR_INVALID_NETWORK, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
@@ -6096,7 +5822,7 @@ virConnectNumOfNetworks(virConnectPtr conn)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -6109,7 +5835,7 @@ virConnectNumOfNetworks(virConnectPtr conn)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -6134,13 +5860,13 @@ virConnectListNetworks(virConnectPtr conn, char **const names, int maxnames)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     if ((names == NULL) || (maxnames < 0)) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -6152,7 +5878,7 @@ virConnectListNetworks(virConnectPtr conn, char **const names, int maxnames)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -6175,7 +5901,7 @@ virConnectNumOfDefinedNetworks(virConnectPtr conn)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -6188,7 +5914,7 @@ virConnectNumOfDefinedNetworks(virConnectPtr conn)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -6214,13 +5940,13 @@ virConnectListDefinedNetworks(virConnectPtr conn, char **const names,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     if ((names == NULL) || (maxnames < 0)) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -6233,7 +5959,7 @@ virConnectListDefinedNetworks(virConnectPtr conn, char **const names,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -6258,12 +5984,12 @@ virNetworkLookupByName(virConnectPtr conn, const char *name)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (name == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto  error;
     }
 
@@ -6275,7 +6001,7 @@ virNetworkLookupByName(virConnectPtr conn, const char *name)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -6303,12 +6029,12 @@ virNetworkLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (uuid == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -6320,7 +6046,7 @@ virNetworkLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -6346,17 +6072,17 @@ virNetworkLookupByUUIDString(virConnectPtr conn, const char *uuidstr)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (uuidstr == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
     if (virUUIDParse(uuidstr, uuid) < 0) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -6385,16 +6111,16 @@ virNetworkCreateXML(virConnectPtr conn, const char *xmlDesc)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (xmlDesc == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -6406,7 +6132,7 @@ virNetworkCreateXML(virConnectPtr conn, const char *xmlDesc)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -6430,16 +6156,16 @@ virNetworkDefineXML(virConnectPtr conn, const char *xml)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
     if (xml == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -6451,7 +6177,7 @@ virNetworkDefineXML(virConnectPtr conn, const char *xml)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -6474,13 +6200,13 @@ virNetworkUndefine(virNetworkPtr network) {
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NETWORK(network)) {
-        virLibNetworkError(NULL, VIR_ERR_INVALID_NETWORK, __FUNCTION__);
+        virLibNetworkError(VIR_ERR_INVALID_NETWORK, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     conn = network->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibNetworkError(network, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibNetworkError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -6492,7 +6218,7 @@ virNetworkUndefine(virNetworkPtr network) {
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(network->conn);
@@ -6517,13 +6243,13 @@ virNetworkCreate(virNetworkPtr network)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NETWORK(network)) {
-        virLibNetworkError(NULL, VIR_ERR_INVALID_NETWORK, __FUNCTION__);
+        virLibNetworkError(VIR_ERR_INVALID_NETWORK, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     conn = network->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibNetworkError(network, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibNetworkError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -6535,7 +6261,7 @@ virNetworkCreate(virNetworkPtr network)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(network->conn);
@@ -6562,14 +6288,14 @@ virNetworkDestroy(virNetworkPtr network)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NETWORK(network)) {
-        virLibNetworkError(NULL, VIR_ERR_INVALID_NETWORK, __FUNCTION__);
+        virLibNetworkError(VIR_ERR_INVALID_NETWORK, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     conn = network->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibNetworkError(network, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibNetworkError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -6581,7 +6307,7 @@ virNetworkDestroy(virNetworkPtr network)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(network->conn);
@@ -6605,7 +6331,7 @@ virNetworkFree(virNetworkPtr network)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NETWORK(network)) {
-        virLibNetworkError(NULL, VIR_ERR_INVALID_NETWORK, __FUNCTION__);
+        virLibNetworkError(VIR_ERR_INVALID_NETWORK, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -6637,7 +6363,7 @@ int
 virNetworkRef(virNetworkPtr network)
 {
     if ((!VIR_IS_CONNECTED_NETWORK(network))) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         virDispatchError(NULL);
         return(-1);
     }
@@ -6665,7 +6391,7 @@ virNetworkGetName(virNetworkPtr network)
     virResetLastError();
 
     if (!VIR_IS_NETWORK(network)) {
-        virLibNetworkError(NULL, VIR_ERR_INVALID_NETWORK, __FUNCTION__);
+        virLibNetworkError(VIR_ERR_INVALID_NETWORK, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
@@ -6689,12 +6415,12 @@ virNetworkGetUUID(virNetworkPtr network, unsigned char *uuid)
     virResetLastError();
 
     if (!VIR_IS_NETWORK(network)) {
-        virLibNetworkError(NULL, VIR_ERR_INVALID_NETWORK, __FUNCTION__);
+        virLibNetworkError(VIR_ERR_INVALID_NETWORK, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (uuid == NULL) {
-        virLibNetworkError(network, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibNetworkError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -6726,12 +6452,12 @@ virNetworkGetUUIDString(virNetworkPtr network, char *buf)
     virResetLastError();
 
     if (!VIR_IS_NETWORK(network)) {
-        virLibNetworkError(NULL, VIR_ERR_INVALID_NETWORK, __FUNCTION__);
+        virLibNetworkError(VIR_ERR_INVALID_NETWORK, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (buf == NULL) {
-        virLibNetworkError(network, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibNetworkError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -6766,12 +6492,12 @@ virNetworkGetXMLDesc(virNetworkPtr network, int flags)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NETWORK(network)) {
-        virLibNetworkError(NULL, VIR_ERR_INVALID_NETWORK, __FUNCTION__);
+        virLibNetworkError(VIR_ERR_INVALID_NETWORK, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (flags != 0) {
-        virLibNetworkError(network, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibNetworkError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -6785,7 +6511,7 @@ virNetworkGetXMLDesc(virNetworkPtr network, int flags)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(network->conn);
@@ -6811,7 +6537,7 @@ virNetworkGetBridgeName(virNetworkPtr network)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NETWORK(network)) {
-        virLibNetworkError(NULL, VIR_ERR_INVALID_NETWORK, __FUNCTION__);
+        virLibNetworkError(VIR_ERR_INVALID_NETWORK, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
@@ -6826,7 +6552,7 @@ virNetworkGetBridgeName(virNetworkPtr network)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(network->conn);
@@ -6854,12 +6580,12 @@ virNetworkGetAutostart(virNetworkPtr network,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NETWORK(network)) {
-        virLibNetworkError(NULL, VIR_ERR_INVALID_NETWORK, __FUNCTION__);
+        virLibNetworkError(VIR_ERR_INVALID_NETWORK, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (!autostart) {
-        virLibNetworkError(network, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibNetworkError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -6873,7 +6599,7 @@ virNetworkGetAutostart(virNetworkPtr network,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(network->conn);
@@ -6900,13 +6626,13 @@ virNetworkSetAutostart(virNetworkPtr network,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NETWORK(network)) {
-        virLibNetworkError(NULL, VIR_ERR_INVALID_NETWORK, __FUNCTION__);
+        virLibNetworkError(VIR_ERR_INVALID_NETWORK, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     if (network->conn->flags & VIR_CONNECT_RO) {
-        virLibNetworkError(network, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibNetworkError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -6920,7 +6646,7 @@ virNetworkSetAutostart(virNetworkPtr network,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(network->conn);
@@ -6949,7 +6675,7 @@ virInterfaceGetConnect (virInterfacePtr iface)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_INTERFACE (iface)) {
-        virLibInterfaceError (NULL, VIR_ERR_INVALID_INTERFACE, __FUNCTION__);
+        virLibInterfaceError(VIR_ERR_INVALID_INTERFACE, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
@@ -6972,7 +6698,7 @@ virConnectNumOfInterfaces(virConnectPtr conn)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -6985,7 +6711,7 @@ virConnectNumOfInterfaces(virConnectPtr conn)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -7011,13 +6737,13 @@ virConnectListInterfaces(virConnectPtr conn, char **const names, int maxnames)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     if ((names == NULL) || (maxnames < 0)) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -7029,7 +6755,7 @@ virConnectListInterfaces(virConnectPtr conn, char **const names, int maxnames)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -7052,7 +6778,7 @@ virConnectNumOfDefinedInterfaces(virConnectPtr conn)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -7065,7 +6791,7 @@ virConnectNumOfDefinedInterfaces(virConnectPtr conn)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -7093,13 +6819,13 @@ virConnectListDefinedInterfaces(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     if ((names == NULL) || (maxnames < 0)) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -7111,7 +6837,7 @@ virConnectListDefinedInterfaces(virConnectPtr conn,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -7136,12 +6862,12 @@ virInterfaceLookupByName(virConnectPtr conn, const char *name)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (name == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto  error;
     }
 
@@ -7153,7 +6879,7 @@ virInterfaceLookupByName(virConnectPtr conn, const char *name)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -7178,12 +6904,12 @@ virInterfaceLookupByMACString(virConnectPtr conn, const char *macstr)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (macstr == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto  error;
     }
 
@@ -7195,7 +6921,7 @@ virInterfaceLookupByMACString(virConnectPtr conn, const char *macstr)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -7219,7 +6945,7 @@ virInterfaceGetName(virInterfacePtr iface)
     virResetLastError();
 
     if (!VIR_IS_INTERFACE(iface)) {
-        virLibInterfaceError(NULL, VIR_ERR_INVALID_INTERFACE, __FUNCTION__);
+        virLibInterfaceError(VIR_ERR_INVALID_INTERFACE, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
@@ -7245,7 +6971,7 @@ virInterfaceGetMACString(virInterfacePtr iface)
     virResetLastError();
 
     if (!VIR_IS_INTERFACE(iface)) {
-        virLibInterfaceError(NULL, VIR_ERR_INVALID_INTERFACE, __FUNCTION__);
+        virLibInterfaceError(VIR_ERR_INVALID_INTERFACE, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
@@ -7279,12 +7005,12 @@ virInterfaceGetXMLDesc(virInterfacePtr iface, unsigned int flags)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_INTERFACE(iface)) {
-        virLibInterfaceError(NULL, VIR_ERR_INVALID_INTERFACE, __FUNCTION__);
+        virLibInterfaceError(VIR_ERR_INVALID_INTERFACE, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if ((flags & ~VIR_INTERFACE_XML_INACTIVE) != 0) {
-        virLibInterfaceError(iface, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibInterfaceError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -7298,7 +7024,7 @@ virInterfaceGetXMLDesc(virInterfacePtr iface, unsigned int flags)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(iface->conn);
@@ -7323,16 +7049,16 @@ virInterfaceDefineXML(virConnectPtr conn, const char *xml, unsigned int flags)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
     if (xml == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -7344,7 +7070,7 @@ virInterfaceDefineXML(virConnectPtr conn, const char *xml, unsigned int flags)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -7368,13 +7094,13 @@ virInterfaceUndefine(virInterfacePtr iface) {
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_INTERFACE(iface)) {
-        virLibInterfaceError(NULL, VIR_ERR_INVALID_INTERFACE, __FUNCTION__);
+        virLibInterfaceError(VIR_ERR_INVALID_INTERFACE, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     conn = iface->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibInterfaceError(iface, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibInterfaceError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -7386,7 +7112,7 @@ virInterfaceUndefine(virInterfacePtr iface) {
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(iface->conn);
@@ -7411,13 +7137,13 @@ virInterfaceCreate(virInterfacePtr iface, unsigned int flags)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_INTERFACE(iface)) {
-        virLibInterfaceError(NULL, VIR_ERR_INVALID_INTERFACE, __FUNCTION__);
+        virLibInterfaceError(VIR_ERR_INVALID_INTERFACE, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     conn = iface->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibInterfaceError(iface, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibInterfaceError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -7429,7 +7155,7 @@ virInterfaceCreate(virInterfacePtr iface, unsigned int flags)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(iface->conn);
@@ -7456,14 +7182,14 @@ virInterfaceDestroy(virInterfacePtr iface, unsigned int flags)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_INTERFACE(iface)) {
-        virLibInterfaceError(NULL, VIR_ERR_INVALID_INTERFACE, __FUNCTION__);
+        virLibInterfaceError(VIR_ERR_INVALID_INTERFACE, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     conn = iface->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibInterfaceError(iface, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibInterfaceError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -7475,7 +7201,7 @@ virInterfaceDestroy(virInterfacePtr iface, unsigned int flags)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(iface->conn);
@@ -7503,7 +7229,7 @@ int
 virInterfaceRef(virInterfacePtr iface)
 {
     if ((!VIR_IS_CONNECTED_INTERFACE(iface))) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         virDispatchError(NULL);
         return(-1);
     }
@@ -7531,7 +7257,7 @@ virInterfaceFree(virInterfacePtr iface)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_INTERFACE(iface)) {
-        virLibInterfaceError(NULL, VIR_ERR_INVALID_INTERFACE, __FUNCTION__);
+        virLibInterfaceError(VIR_ERR_INVALID_INTERFACE, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -7565,7 +7291,7 @@ virStoragePoolGetConnect (virStoragePoolPtr pool)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STORAGE_POOL (pool)) {
-        virLibStoragePoolError (NULL, VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
@@ -7588,7 +7314,7 @@ virConnectNumOfStoragePools	(virConnectPtr conn)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -7601,7 +7327,7 @@ virConnectNumOfStoragePools	(virConnectPtr conn)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -7630,13 +7356,13 @@ virConnectListStoragePools	(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     if ((names == NULL) || (maxnames < 0)) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -7648,7 +7374,7 @@ virConnectListStoragePools	(virConnectPtr conn,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -7672,7 +7398,7 @@ virConnectNumOfDefinedStoragePools(virConnectPtr conn)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -7685,7 +7411,7 @@ virConnectNumOfDefinedStoragePools(virConnectPtr conn)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -7715,13 +7441,13 @@ virConnectListDefinedStoragePools(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     if ((names == NULL) || (maxnames < 0)) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -7733,7 +7459,7 @@ virConnectListDefinedStoragePools(virConnectPtr conn,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -7773,17 +7499,17 @@ virConnectFindStoragePoolSources(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
     if (type == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -7795,7 +7521,7 @@ virConnectFindStoragePoolSources(virConnectPtr conn,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -7821,12 +7547,12 @@ virStoragePoolLookupByName(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (name == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -7838,7 +7564,7 @@ virStoragePoolLookupByName(virConnectPtr conn,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -7864,12 +7590,12 @@ virStoragePoolLookupByUUID(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (uuid == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -7881,7 +7607,7 @@ virStoragePoolLookupByUUID(virConnectPtr conn,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -7908,17 +7634,17 @@ virStoragePoolLookupByUUIDString(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (uuidstr == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
     if (virUUIDParse(uuidstr, uuid) < 0) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -7946,7 +7672,7 @@ virStoragePoolLookupByVolume(virStorageVolPtr vol)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STORAGE_VOL(vol)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
@@ -7959,7 +7685,7 @@ virStoragePoolLookupByVolume(virStorageVolPtr vol)
         return ret;
     }
 
-    virLibConnError (vol->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(vol->conn);
@@ -7988,16 +7714,16 @@ virStoragePoolCreateXML(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (xmlDesc == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -8009,7 +7735,7 @@ virStoragePoolCreateXML(virConnectPtr conn,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -8037,16 +7763,16 @@ virStoragePoolDefineXML(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
     if (xml == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -8058,7 +7784,7 @@ virStoragePoolDefineXML(virConnectPtr conn,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -8084,13 +7810,13 @@ virStoragePoolBuild(virStoragePoolPtr pool,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STORAGE_POOL(pool)) {
-        virLibStoragePoolError(NULL, VIR_ERR_INVALID_NETWORK, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_INVALID_NETWORK, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     conn = pool->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibStoragePoolError(pool, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -8102,7 +7828,7 @@ virStoragePoolBuild(virStoragePoolPtr pool,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(pool->conn);
@@ -8127,13 +7853,13 @@ virStoragePoolUndefine(virStoragePoolPtr pool)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STORAGE_POOL(pool)) {
-        virLibStoragePoolError(NULL, VIR_ERR_INVALID_NETWORK, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_INVALID_NETWORK, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     conn = pool->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibStoragePoolError(pool, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -8145,7 +7871,7 @@ virStoragePoolUndefine(virStoragePoolPtr pool)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(pool->conn);
@@ -8172,13 +7898,13 @@ virStoragePoolCreate(virStoragePoolPtr pool,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STORAGE_POOL(pool)) {
-        virLibStoragePoolError(NULL, VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     conn = pool->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibStoragePoolError(pool, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -8190,7 +7916,7 @@ virStoragePoolCreate(virStoragePoolPtr pool,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(pool->conn);
@@ -8219,14 +7945,14 @@ virStoragePoolDestroy(virStoragePoolPtr pool)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STORAGE_POOL(pool)) {
-        virLibStoragePoolError(NULL, VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     conn = pool->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibStoragePoolError(pool, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -8238,7 +7964,7 @@ virStoragePoolDestroy(virStoragePoolPtr pool)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(pool->conn);
@@ -8266,14 +7992,14 @@ virStoragePoolDelete(virStoragePoolPtr pool,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STORAGE_POOL(pool)) {
-        virLibStoragePoolError(NULL, VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     conn = pool->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibStoragePoolError(pool, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -8285,7 +8011,7 @@ virStoragePoolDelete(virStoragePoolPtr pool,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(pool->conn);
@@ -8310,7 +8036,7 @@ virStoragePoolFree(virStoragePoolPtr pool)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STORAGE_POOL(pool)) {
-        virLibStoragePoolError(NULL, VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -8344,7 +8070,7 @@ int
 virStoragePoolRef(virStoragePoolPtr pool)
 {
     if ((!VIR_IS_CONNECTED_STORAGE_POOL(pool))) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         virDispatchError(NULL);
         return(-1);
     }
@@ -8376,14 +8102,14 @@ virStoragePoolRefresh(virStoragePoolPtr pool,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STORAGE_POOL(pool)) {
-        virLibStoragePoolError(NULL, VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     conn = pool->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibStoragePoolError(pool, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -8395,7 +8121,7 @@ virStoragePoolRefresh(virStoragePoolPtr pool,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(pool->conn);
@@ -8419,7 +8145,7 @@ virStoragePoolGetName(virStoragePoolPtr pool)
     virResetLastError();
 
     if (!VIR_IS_STORAGE_POOL(pool)) {
-        virLibStoragePoolError(NULL, VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
@@ -8445,12 +8171,12 @@ virStoragePoolGetUUID(virStoragePoolPtr pool,
     virResetLastError();
 
     if (!VIR_IS_STORAGE_POOL(pool)) {
-        virLibStoragePoolError(NULL, VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (uuid == NULL) {
-        virLibStoragePoolError(pool, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -8482,12 +8208,12 @@ virStoragePoolGetUUIDString(virStoragePoolPtr pool,
     virResetLastError();
 
     if (!VIR_IS_STORAGE_POOL(pool)) {
-        virLibStoragePoolError(NULL, VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (buf == NULL) {
-        virLibStoragePoolError(pool, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -8523,12 +8249,12 @@ virStoragePoolGetInfo(virStoragePoolPtr pool,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STORAGE_POOL(pool)) {
-        virLibStoragePoolError(NULL, VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (info == NULL) {
-        virLibStoragePoolError(pool, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -8544,7 +8270,7 @@ virStoragePoolGetInfo(virStoragePoolPtr pool,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(pool->conn);
@@ -8573,12 +8299,12 @@ virStoragePoolGetXMLDesc(virStoragePoolPtr pool,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STORAGE_POOL(pool)) {
-        virLibStoragePoolError(NULL, VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (flags != 0) {
-        virLibStoragePoolError(pool, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -8592,7 +8318,7 @@ virStoragePoolGetXMLDesc(virStoragePoolPtr pool,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(pool->conn);
@@ -8620,12 +8346,12 @@ virStoragePoolGetAutostart(virStoragePoolPtr pool,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STORAGE_POOL(pool)) {
-        virLibStoragePoolError(NULL, VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (!autostart) {
-        virLibStoragePoolError(pool, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -8639,7 +8365,7 @@ virStoragePoolGetAutostart(virStoragePoolPtr pool,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(pool->conn);
@@ -8666,13 +8392,13 @@ virStoragePoolSetAutostart(virStoragePoolPtr pool,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STORAGE_POOL(pool)) {
-        virLibStoragePoolError(NULL, VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
 
     if (pool->conn->flags & VIR_CONNECT_RO) {
-        virLibStoragePoolError(pool, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibStoragePoolError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -8686,7 +8412,7 @@ virStoragePoolSetAutostart(virStoragePoolPtr pool,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(pool->conn);
@@ -8710,7 +8436,7 @@ virStoragePoolNumOfVolumes(virStoragePoolPtr pool)
     virResetLastError();
 
     if (!VIR_IS_STORAGE_POOL(pool)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -8723,7 +8449,7 @@ virStoragePoolNumOfVolumes(virStoragePoolPtr pool)
         return ret;
     }
 
-    virLibConnError (pool->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(pool->conn);
@@ -8752,13 +8478,13 @@ virStoragePoolListVolumes(virStoragePoolPtr pool,
     virResetLastError();
 
     if (!VIR_IS_STORAGE_POOL(pool)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     if ((names == NULL) || (maxnames < 0)) {
-        virLibConnError(pool->conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -8770,7 +8496,7 @@ virStoragePoolListVolumes(virStoragePoolPtr pool,
         return ret;
     }
 
-    virLibConnError (pool->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(pool->conn);
@@ -8800,7 +8526,7 @@ virStorageVolGetConnect (virStorageVolPtr vol)
     virResetLastError();
 
     if (!VIR_IS_STORAGE_VOL (vol)) {
-        virLibStoragePoolError (NULL, VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
+        virLibStorageVolError(VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
@@ -8827,12 +8553,12 @@ virStorageVolLookupByName(virStoragePoolPtr pool,
     virResetLastError();
 
     if (!VIR_IS_STORAGE_POOL(pool)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (name == NULL) {
-        virLibConnError(pool->conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -8844,7 +8570,7 @@ virStorageVolLookupByName(virStoragePoolPtr pool,
         return ret;
     }
 
-    virLibConnError (pool->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(pool->conn);
@@ -8872,12 +8598,12 @@ virStorageVolLookupByKey(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (key == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -8889,7 +8615,7 @@ virStorageVolLookupByKey(virConnectPtr conn,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -8915,12 +8641,12 @@ virStorageVolLookupByPath(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (path == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -8932,7 +8658,7 @@ virStorageVolLookupByPath(virConnectPtr conn,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -8957,7 +8683,7 @@ virStorageVolGetName(virStorageVolPtr vol)
     virResetLastError();
 
     if (!VIR_IS_STORAGE_VOL(vol)) {
-        virLibStorageVolError(NULL, VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
+        virLibStorageVolError(VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
@@ -8983,7 +8709,7 @@ virStorageVolGetKey(virStorageVolPtr vol)
     virResetLastError();
 
     if (!VIR_IS_STORAGE_VOL(vol)) {
-        virLibStorageVolError(NULL, VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
+        virLibStorageVolError(VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
@@ -9013,13 +8739,13 @@ virStorageVolCreateXML(virStoragePoolPtr pool,
     virResetLastError();
 
     if (!VIR_IS_STORAGE_POOL(pool)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
 
     if (pool->conn->flags & VIR_CONNECT_RO) {
-        virLibConnError(pool->conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -9031,7 +8757,7 @@ virStorageVolCreateXML(virStoragePoolPtr pool,
         return ret;
     }
 
-    virLibConnError (pool->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(pool->conn);
@@ -9064,19 +8790,19 @@ virStorageVolCreateXMLFrom(virStoragePoolPtr pool,
     virResetLastError();
 
     if (!VIR_IS_STORAGE_POOL(pool)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_STORAGE_POOL, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
 
     if (!VIR_IS_STORAGE_VOL(clonevol)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
         goto error;
     }
 
     if (pool->conn->flags & VIR_CONNECT_RO ||
         clonevol->conn->flags & VIR_CONNECT_RO) {
-        virLibConnError(pool->conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -9090,7 +8816,7 @@ virStorageVolCreateXMLFrom(virStoragePoolPtr pool,
         return ret;
     }
 
-    virLibConnError (pool->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(pool->conn);
@@ -9117,14 +8843,14 @@ virStorageVolDelete(virStorageVolPtr vol,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STORAGE_VOL(vol)) {
-        virLibStorageVolError(NULL, VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
+        virLibStorageVolError(VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     conn = vol->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibStorageVolError(vol, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibStorageVolError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -9136,7 +8862,7 @@ virStorageVolDelete(virStorageVolPtr vol,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(vol->conn);
@@ -9163,14 +8889,14 @@ virStorageVolWipe(virStorageVolPtr vol,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STORAGE_VOL(vol)) {
-        virLibStorageVolError(NULL, VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
+        virLibStorageVolError(VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     conn = vol->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibStorageVolError(vol, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibStorageVolError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -9183,7 +8909,7 @@ virStorageVolWipe(virStorageVolPtr vol,
         return ret;
     }
 
-    virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(vol->conn);
@@ -9208,7 +8934,7 @@ virStorageVolFree(virStorageVolPtr vol)
     virResetLastError();
 
     if (!VIR_IS_STORAGE_VOL(vol)) {
-        virLibStorageVolError(NULL, VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
+        virLibStorageVolError(VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -9241,7 +8967,7 @@ int
 virStorageVolRef(virStorageVolPtr vol)
 {
     if ((!VIR_IS_CONNECTED_STORAGE_VOL(vol))) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         virDispatchError(NULL);
         return(-1);
     }
@@ -9272,12 +8998,12 @@ virStorageVolGetInfo(virStorageVolPtr vol,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STORAGE_VOL(vol)) {
-        virLibStorageVolError(NULL, VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
+        virLibStorageVolError(VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (info == NULL) {
-        virLibStorageVolError(vol, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibStorageVolError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -9293,7 +9019,7 @@ virStorageVolGetInfo(virStorageVolPtr vol,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(vol->conn);
@@ -9321,12 +9047,12 @@ virStorageVolGetXMLDesc(virStorageVolPtr vol,
     virResetLastError();
 
     if (!VIR_IS_STORAGE_VOL(vol)) {
-        virLibStorageVolError(NULL, VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
+        virLibStorageVolError(VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (flags != 0) {
-        virLibStorageVolError(vol, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibStorageVolError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -9340,7 +9066,7 @@ virStorageVolGetXMLDesc(virStorageVolPtr vol,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(vol->conn);
@@ -9369,7 +9095,7 @@ virStorageVolGetPath(virStorageVolPtr vol)
     virResetLastError();
 
     if (!VIR_IS_STORAGE_VOL(vol)) {
-        virLibStorageVolError(NULL, VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
+        virLibStorageVolError(VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
@@ -9384,7 +9110,7 @@ virStorageVolGetPath(virStorageVolPtr vol)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(vol->conn);
@@ -9413,12 +9139,12 @@ virNodeNumOfDevices(virConnectPtr conn, const char *cap, unsigned int flags)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (flags != 0) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -9430,7 +9156,7 @@ virNodeNumOfDevices(virConnectPtr conn, const char *cap, unsigned int flags)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -9465,12 +9191,12 @@ virNodeListDevices(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if ((flags != 0) || (names == NULL) || (maxnames < 0)) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -9482,7 +9208,7 @@ virNodeListDevices(virConnectPtr conn,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -9506,13 +9232,13 @@ virNodeDevicePtr virNodeDeviceLookupByName(virConnectPtr conn, const char *name)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
 
     if (name == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -9524,7 +9250,7 @@ virNodeDevicePtr virNodeDeviceLookupByName(virConnectPtr conn, const char *name)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -9549,7 +9275,7 @@ char *virNodeDeviceGetXMLDesc(virNodeDevicePtr dev, unsigned int flags)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NODE_DEVICE(dev)) {
-        virLibNodeDeviceError(NULL, VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
+        virLibNodeDeviceError(VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
@@ -9562,7 +9288,7 @@ char *virNodeDeviceGetXMLDesc(virNodeDevicePtr dev, unsigned int flags)
         return ret;
     }
 
-    virLibConnError (dev->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(dev->conn);
@@ -9583,7 +9309,7 @@ const char *virNodeDeviceGetName(virNodeDevicePtr dev)
     DEBUG("dev=%p, conn=%p", dev, dev ? dev->conn : NULL);
 
     if (!VIR_IS_CONNECTED_NODE_DEVICE(dev)) {
-        virLibNodeDeviceError(NULL, VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
+        virLibNodeDeviceError(VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
@@ -9607,7 +9333,7 @@ const char *virNodeDeviceGetParent(virNodeDevicePtr dev)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NODE_DEVICE(dev)) {
-        virLibNodeDeviceError(NULL, VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
+        virLibNodeDeviceError(VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
@@ -9616,7 +9342,7 @@ const char *virNodeDeviceGetParent(virNodeDevicePtr dev)
         if (dev->conn->deviceMonitor && dev->conn->deviceMonitor->deviceGetParent) {
             dev->parent = dev->conn->deviceMonitor->deviceGetParent (dev);
         } else {
-            virLibConnError (dev->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+            virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
             virDispatchError(dev->conn);
             return NULL;
         }
@@ -9639,7 +9365,7 @@ int virNodeDeviceNumOfCaps(virNodeDevicePtr dev)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NODE_DEVICE(dev)) {
-        virLibNodeDeviceError(NULL, VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
+        virLibNodeDeviceError(VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
@@ -9652,7 +9378,7 @@ int virNodeDeviceNumOfCaps(virNodeDevicePtr dev)
         return ret;
     }
 
-    virLibConnError (dev->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(dev->conn);
@@ -9679,7 +9405,7 @@ int virNodeDeviceListCaps(virNodeDevicePtr dev,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NODE_DEVICE(dev)) {
-        virLibNodeDeviceError(NULL, VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
+        virLibNodeDeviceError(VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
@@ -9692,7 +9418,7 @@ int virNodeDeviceListCaps(virNodeDevicePtr dev,
         return ret;
     }
 
-    virLibConnError (dev->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(dev->conn);
@@ -9716,7 +9442,7 @@ int virNodeDeviceFree(virNodeDevicePtr dev)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NODE_DEVICE(dev)) {
-        virLibNodeDeviceError(NULL, VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
+        virLibNodeDeviceError(VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -9749,7 +9475,7 @@ int
 virNodeDeviceRef(virNodeDevicePtr dev)
 {
     if ((!VIR_IS_CONNECTED_NODE_DEVICE(dev))) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         virDispatchError(NULL);
         return(-1);
     }
@@ -9787,7 +9513,7 @@ virNodeDeviceDettach(virNodeDevicePtr dev)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NODE_DEVICE(dev)) {
-        virLibNodeDeviceError(NULL, VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
+        virLibNodeDeviceError(VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -9800,7 +9526,7 @@ virNodeDeviceDettach(virNodeDevicePtr dev)
         return ret;
     }
 
-    virLibConnError(dev->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(dev->conn);
@@ -9830,7 +9556,7 @@ virNodeDeviceReAttach(virNodeDevicePtr dev)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NODE_DEVICE(dev)) {
-        virLibNodeDeviceError(NULL, VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
+        virLibNodeDeviceError(VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -9843,7 +9569,7 @@ virNodeDeviceReAttach(virNodeDevicePtr dev)
         return ret;
     }
 
-    virLibConnError(dev->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(dev->conn);
@@ -9875,7 +9601,7 @@ virNodeDeviceReset(virNodeDevicePtr dev)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NODE_DEVICE(dev)) {
-        virLibNodeDeviceError(NULL, VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
+        virLibNodeDeviceError(VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -9888,7 +9614,7 @@ virNodeDeviceReset(virNodeDevicePtr dev)
         return ret;
     }
 
-    virLibConnError(dev->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(dev->conn);
@@ -9917,18 +9643,18 @@ virNodeDeviceCreateXML(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
 
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
     if (xmlDesc == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -9940,7 +9666,7 @@ virNodeDeviceCreateXML(virConnectPtr conn,
         return dev;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -9965,13 +9691,13 @@ virNodeDeviceDestroy(virNodeDevicePtr dev)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NODE_DEVICE(dev)) {
-        virLibNodeDeviceError(NULL, VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
+        virLibNodeDeviceError(VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     if (dev->conn->flags & VIR_CONNECT_RO) {
-        virLibConnError(dev->conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -9985,7 +9711,7 @@ virNodeDeviceDestroy(virNodeDevicePtr dev)
         return 0;
     }
 
-    virLibConnError (dev->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(dev->conn);
@@ -10030,12 +9756,12 @@ virConnectDomainEventRegister(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (cb == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -10047,7 +9773,7 @@ virConnectDomainEventRegister(virConnectPtr conn,
         return ret;
     }
 
-    virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(conn);
     return -1;
@@ -10076,12 +9802,12 @@ virConnectDomainEventDeregister(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (cb == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
     if ((conn->driver) && (conn->driver->domainEventDeregister)) {
@@ -10092,7 +9818,7 @@ virConnectDomainEventDeregister(virConnectPtr conn,
         return ret;
     }
 
-    virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(conn);
     return -1;
@@ -10118,7 +9844,7 @@ virSecretGetConnect (virSecretPtr secret)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_SECRET (secret)) {
-        virLibSecretError (NULL, VIR_ERR_INVALID_SECRET, __FUNCTION__);
+        virLibSecretError(VIR_ERR_INVALID_SECRET, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
@@ -10141,7 +9867,7 @@ virConnectNumOfSecrets(virConnectPtr conn)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
@@ -10156,7 +9882,7 @@ virConnectNumOfSecrets(virConnectPtr conn)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -10181,12 +9907,12 @@ virConnectListSecrets(virConnectPtr conn, char **uuids, int maxuuids)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
     if (uuids == NULL || maxuuids < 0) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -10199,7 +9925,7 @@ virConnectListSecrets(virConnectPtr conn, char **uuids, int maxuuids)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -10225,12 +9951,12 @@ virSecretLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (uuid == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -10243,7 +9969,7 @@ virSecretLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -10270,17 +9996,17 @@ virSecretLookupByUUIDString(virConnectPtr conn, const char *uuidstr)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (uuidstr == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
     if (virUUIDParse(uuidstr, uuid) < 0) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -10315,12 +10041,12 @@ virSecretLookupByUsage(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (usageID == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -10333,7 +10059,7 @@ virSecretLookupByUsage(virConnectPtr conn,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -10364,16 +10090,16 @@ virSecretDefineXML(virConnectPtr conn, const char *xml, unsigned int flags)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
     if (xml == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -10386,7 +10112,7 @@ virSecretDefineXML(virConnectPtr conn, const char *xml, unsigned int flags)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -10411,12 +10137,12 @@ virSecretGetUUID(virSecretPtr secret, unsigned char *uuid)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_SECRET(secret)) {
-        virLibSecretError(NULL, VIR_ERR_INVALID_SECRET, __FUNCTION__);
+        virLibSecretError(VIR_ERR_INVALID_SECRET, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
     if (uuid == NULL) {
-        virLibSecretError(secret, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibSecretError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         virDispatchError(secret->conn);
         return -1;
     }
@@ -10445,12 +10171,12 @@ virSecretGetUUIDString(virSecretPtr secret, char *buf)
     virResetLastError();
 
     if (!VIR_IS_SECRET(secret)) {
-        virLibSecretError(NULL, VIR_ERR_INVALID_SECRET, __FUNCTION__);
+        virLibSecretError(VIR_ERR_INVALID_SECRET, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (buf == NULL) {
-        virLibSecretError(secret, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibSecretError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -10486,7 +10212,7 @@ virSecretGetUsageType(virSecretPtr secret)
     virResetLastError();
 
     if (!VIR_IS_SECRET(secret)) {
-        virLibSecretError(NULL, VIR_ERR_INVALID_SECRET, __FUNCTION__);
+        virLibSecretError(VIR_ERR_INVALID_SECRET, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -10517,7 +10243,7 @@ virSecretGetUsageID(virSecretPtr secret)
     virResetLastError();
 
     if (!VIR_IS_SECRET(secret)) {
-        virLibSecretError(NULL, VIR_ERR_INVALID_SECRET, __FUNCTION__);
+        virLibSecretError(VIR_ERR_INVALID_SECRET, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
@@ -10545,7 +10271,7 @@ virSecretGetXMLDesc(virSecretPtr secret, unsigned int flags)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_SECRET(secret)) {
-        virLibSecretError(NULL, VIR_ERR_INVALID_SECRET, __FUNCTION__);
+        virLibSecretError(VIR_ERR_INVALID_SECRET, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
@@ -10560,7 +10286,7 @@ virSecretGetXMLDesc(virSecretPtr secret, unsigned int flags)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -10590,17 +10316,17 @@ virSecretSetValue(virSecretPtr secret, const unsigned char *value,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_SECRET(secret)) {
-        virLibSecretError(NULL, VIR_ERR_INVALID_SECRET, __FUNCTION__);
+        virLibSecretError(VIR_ERR_INVALID_SECRET, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
     conn = secret->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibSecretError(secret, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibSecretError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
     if (value == NULL) {
-        virLibSecretError(secret, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibSecretError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -10613,7 +10339,7 @@ virSecretSetValue(virSecretPtr secret, const unsigned char *value,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -10641,17 +10367,17 @@ virSecretGetValue(virSecretPtr secret, size_t *value_size, unsigned int flags)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_SECRET(secret)) {
-        virLibSecretError(NULL, VIR_ERR_INVALID_SECRET, __FUNCTION__);
+        virLibSecretError(VIR_ERR_INVALID_SECRET, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
     conn = secret->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibSecretError(secret, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibSecretError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
     if (value_size == NULL) {
-        virLibSecretError(secret, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibSecretError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -10666,7 +10392,7 @@ virSecretGetValue(virSecretPtr secret, size_t *value_size, unsigned int flags)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -10692,13 +10418,13 @@ virSecretUndefine(virSecretPtr secret)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_SECRET(secret)) {
-        virLibSecretError(NULL, VIR_ERR_INVALID_SECRET, __FUNCTION__);
+        virLibSecretError(VIR_ERR_INVALID_SECRET, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
     conn = secret->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibSecretError(secret, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibSecretError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -10711,7 +10437,7 @@ virSecretUndefine(virSecretPtr secret)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -10738,7 +10464,7 @@ int
 virSecretRef(virSecretPtr secret)
 {
     if (!VIR_IS_CONNECTED_SECRET(secret)) {
-        virLibSecretError(NULL, VIR_ERR_INVALID_SECRET, __FUNCTION__);
+        virLibSecretError(VIR_ERR_INVALID_SECRET, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
@@ -10765,7 +10491,7 @@ virSecretFree(virSecretPtr secret)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_SECRET(secret)) {
-        virLibSecretError(NULL, VIR_ERR_INVALID_SECRET, __FUNCTION__);
+        virLibSecretError(VIR_ERR_INVALID_SECRET, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
@@ -10807,7 +10533,7 @@ virStreamNew(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
@@ -10835,7 +10561,7 @@ int
 virStreamRef(virStreamPtr stream)
 {
     if ((!VIR_IS_CONNECTED_STREAM(stream))) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         virDispatchError(NULL);
         return(-1);
     }
@@ -10920,7 +10646,7 @@ int virStreamSend(virStreamPtr stream,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STREAM(stream)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -10936,7 +10662,7 @@ int virStreamSend(virStreamPtr stream,
         return ret;
     }
 
-    virLibConnError(stream->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(stream->conn);
@@ -11015,7 +10741,7 @@ int virStreamRecv(virStreamPtr stream,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STREAM(stream)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -11031,7 +10757,7 @@ int virStreamRecv(virStreamPtr stream,
         return ret;
     }
 
-    virLibConnError(stream->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(stream->conn);
@@ -11091,13 +10817,13 @@ int virStreamSendAll(virStreamPtr stream,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STREAM(stream)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     if (stream->flags & VIR_STREAM_NONBLOCK) {
-        virLibConnError(NULL, VIR_ERR_OPERATION_INVALID,
+        virLibConnError(VIR_ERR_OPERATION_INVALID,
                         _("data sources cannot be used for non-blocking streams"));
         goto cleanup;
     }
@@ -11188,13 +10914,13 @@ int virStreamRecvAll(virStreamPtr stream,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STREAM(stream)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     if (stream->flags & VIR_STREAM_NONBLOCK) {
-        virLibConnError(NULL, VIR_ERR_OPERATION_INVALID,
+        virLibConnError(VIR_ERR_OPERATION_INVALID,
                         _("data sinks cannot be used for non-blocking streams"));
         goto cleanup;
     }
@@ -11260,7 +10986,7 @@ int virStreamEventAddCallback(virStreamPtr stream,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STREAM(stream)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -11274,7 +11000,7 @@ int virStreamEventAddCallback(virStreamPtr stream,
         return ret;
     }
 
-    virLibConnError(stream->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(stream->conn);
@@ -11302,7 +11028,7 @@ int virStreamEventUpdateCallback(virStreamPtr stream,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STREAM(stream)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -11316,7 +11042,7 @@ int virStreamEventUpdateCallback(virStreamPtr stream,
         return ret;
     }
 
-    virLibConnError (stream->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(stream->conn);
@@ -11338,7 +11064,7 @@ int virStreamEventRemoveCallback(virStreamPtr stream)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STREAM(stream)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -11352,7 +11078,7 @@ int virStreamEventRemoveCallback(virStreamPtr stream)
         return ret;
     }
 
-    virLibConnError (stream->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(stream->conn);
@@ -11381,7 +11107,7 @@ int virStreamFinish(virStreamPtr stream)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STREAM(stream)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -11395,7 +11121,7 @@ int virStreamFinish(virStreamPtr stream)
         return ret;
     }
 
-    virLibConnError (stream->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(stream->conn);
@@ -11422,7 +11148,7 @@ int virStreamAbort(virStreamPtr stream)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STREAM(stream)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -11436,7 +11162,7 @@ int virStreamAbort(virStreamPtr stream)
         return ret;
     }
 
-    virLibConnError (stream->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(stream->conn);
@@ -11464,7 +11190,7 @@ int virStreamFree(virStreamPtr stream)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STREAM(stream)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -11494,7 +11220,7 @@ int virDomainIsActive(virDomainPtr dom)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(dom)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -11506,7 +11232,7 @@ int virDomainIsActive(virDomainPtr dom)
         return ret;
     }
 
-    virLibConnError(dom->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(dom->conn);
     return -1;
@@ -11528,7 +11254,7 @@ int virDomainIsPersistent(virDomainPtr dom)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(dom)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -11540,7 +11266,7 @@ int virDomainIsPersistent(virDomainPtr dom)
         return ret;
     }
 
-    virLibConnError(dom->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(dom->conn);
     return -1;
@@ -11561,7 +11287,7 @@ int virDomainIsUpdated(virDomainPtr dom)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(dom)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -11573,7 +11299,7 @@ int virDomainIsUpdated(virDomainPtr dom)
         return ret;
     }
 
-    virLibConnError(dom->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(dom->conn);
     return -1;
@@ -11594,7 +11320,7 @@ int virNetworkIsActive(virNetworkPtr net)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NETWORK(net)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -11606,7 +11332,7 @@ int virNetworkIsActive(virNetworkPtr net)
         return ret;
     }
 
-    virLibConnError(net->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(net->conn);
     return -1;
@@ -11629,7 +11355,7 @@ int virNetworkIsPersistent(virNetworkPtr net)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NETWORK(net)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -11641,7 +11367,7 @@ int virNetworkIsPersistent(virNetworkPtr net)
         return ret;
     }
 
-    virLibConnError(net->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(net->conn);
     return -1;
@@ -11663,7 +11389,7 @@ int virStoragePoolIsActive(virStoragePoolPtr pool)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STORAGE_POOL(pool)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -11675,7 +11401,7 @@ int virStoragePoolIsActive(virStoragePoolPtr pool)
         return ret;
     }
 
-    virLibConnError(pool->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(pool->conn);
     return -1;
@@ -11698,7 +11424,7 @@ int virStoragePoolIsPersistent(virStoragePoolPtr pool)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_STORAGE_POOL(pool)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -11710,7 +11436,7 @@ int virStoragePoolIsPersistent(virStoragePoolPtr pool)
         return ret;
     }
 
-    virLibConnError(pool->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(pool->conn);
     return -1;
@@ -11734,7 +11460,7 @@ virConnectNumOfNWFilters(virConnectPtr conn)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
@@ -11747,7 +11473,7 @@ virConnectNumOfNWFilters(virConnectPtr conn)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -11773,13 +11499,13 @@ virConnectListNWFilters(virConnectPtr conn, char **const names, int maxnames)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
 
     if ((names == NULL) || (maxnames < 0)) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -11791,7 +11517,7 @@ virConnectListNWFilters(virConnectPtr conn, char **const names, int maxnames)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -11817,12 +11543,12 @@ virNWFilterLookupByName(virConnectPtr conn, const char *name)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (name == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto  error;
     }
 
@@ -11834,7 +11560,7 @@ virNWFilterLookupByName(virConnectPtr conn, const char *name)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -11859,12 +11585,12 @@ virNWFilterLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (uuid == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -11876,7 +11602,7 @@ virNWFilterLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -11902,17 +11628,17 @@ virNWFilterLookupByUUIDString(virConnectPtr conn, const char *uuidstr)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (uuidstr == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
     if (virUUIDParse(uuidstr, uuid) < 0) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -11940,7 +11666,7 @@ virNWFilterFree(virNWFilterPtr nwfilter)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NWFILTER(nwfilter)) {
-        virLibNWFilterError(NULL, VIR_ERR_INVALID_NWFILTER, __FUNCTION__);
+        virLibNWFilterError(VIR_ERR_INVALID_NWFILTER, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
@@ -11968,7 +11694,7 @@ virNWFilterGetName(virNWFilterPtr nwfilter)
     virResetLastError();
 
     if (!VIR_IS_NWFILTER(nwfilter)) {
-        virLibNWFilterError(NULL, VIR_ERR_INVALID_NWFILTER, __FUNCTION__);
+        virLibNWFilterError(VIR_ERR_INVALID_NWFILTER, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
@@ -11992,12 +11718,12 @@ virNWFilterGetUUID(virNWFilterPtr nwfilter, unsigned char *uuid)
     virResetLastError();
 
     if (!VIR_IS_NWFILTER(nwfilter)) {
-        virLibNWFilterError(NULL, VIR_ERR_INVALID_NWFILTER, __FUNCTION__);
+        virLibNWFilterError(VIR_ERR_INVALID_NWFILTER, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
     if (uuid == NULL) {
-        virLibNWFilterError(nwfilter, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibNWFilterError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -12029,12 +11755,12 @@ virNWFilterGetUUIDString(virNWFilterPtr nwfilter, char *buf)
     virResetLastError();
 
     if (!VIR_IS_NWFILTER(nwfilter)) {
-        virLibNWFilterError(NULL, VIR_ERR_INVALID_NWFILTER, __FUNCTION__);
+        virLibNWFilterError(VIR_ERR_INVALID_NWFILTER, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
     if (buf == NULL) {
-        virLibNWFilterError(nwfilter, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibNWFilterError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -12068,16 +11794,16 @@ virNWFilterDefineXML(virConnectPtr conn, const char *xmlDesc)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (xmlDesc == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -12089,7 +11815,7 @@ virNWFilterDefineXML(virConnectPtr conn, const char *xmlDesc)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -12116,14 +11842,14 @@ virNWFilterUndefine(virNWFilterPtr nwfilter)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NWFILTER(nwfilter)) {
-        virLibNWFilterError(NULL, VIR_ERR_INVALID_NWFILTER, __FUNCTION__);
+        virLibNWFilterError(VIR_ERR_INVALID_NWFILTER, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
 
     conn = nwfilter->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibNWFilterError(nwfilter, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibNWFilterError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -12135,7 +11861,7 @@ virNWFilterUndefine(virNWFilterPtr nwfilter)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(nwfilter->conn);
@@ -12163,12 +11889,12 @@ virNWFilterGetXMLDesc(virNWFilterPtr nwfilter, int flags)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_NWFILTER(nwfilter)) {
-        virLibNWFilterError(NULL, VIR_ERR_INVALID_NWFILTER, __FUNCTION__);
+        virLibNWFilterError(VIR_ERR_INVALID_NWFILTER, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
     if (flags != 0) {
-        virLibNWFilterError(nwfilter, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibNWFilterError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -12182,7 +11908,7 @@ virNWFilterGetXMLDesc(virNWFilterPtr nwfilter, int flags)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(nwfilter->conn);
@@ -12211,7 +11937,7 @@ int
 virNWFilterRef(virNWFilterPtr nwfilter)
 {
     if ((!VIR_IS_CONNECTED_NWFILTER(nwfilter))) {
-        virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
@@ -12238,7 +11964,7 @@ int virInterfaceIsActive(virInterfacePtr iface)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_INTERFACE(iface)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -12250,7 +11976,7 @@ int virInterfaceIsActive(virInterfacePtr iface)
         return ret;
     }
 
-    virLibConnError(iface->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(iface->conn);
     return -1;
@@ -12272,7 +11998,7 @@ int virConnectIsEncrypted(virConnectPtr conn)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -12284,7 +12010,7 @@ int virConnectIsEncrypted(virConnectPtr conn)
         return ret;
     }
 
-    virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(conn);
     return -1;
@@ -12309,7 +12035,7 @@ int virConnectIsSecure(virConnectPtr conn)
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
@@ -12321,7 +12047,7 @@ int virConnectIsSecure(virConnectPtr conn)
         return ret;
     }
 
-    virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(conn);
     return -1;
@@ -12348,12 +12074,12 @@ virConnectCompareCPU(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return VIR_CPU_COMPARE_ERROR;
     }
     if (xmlDesc == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -12366,7 +12092,7 @@ virConnectCompareCPU(virConnectPtr conn,
         return ret;
     }
 
-    virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -12405,12 +12131,12 @@ virConnectBaselineCPU(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
     if (xmlCPUs == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -12423,7 +12149,7 @@ virConnectBaselineCPU(virConnectPtr conn,
         return cpu;
     }
 
-    virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -12451,12 +12177,12 @@ virDomainGetJobInfo(virDomainPtr domain, virDomainJobInfoPtr info)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (info == NULL) {
-        virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -12472,7 +12198,7 @@ virDomainGetJobInfo(virDomainPtr domain, virDomainJobInfoPtr info)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(domain->conn);
@@ -12500,14 +12226,14 @@ virDomainAbortJob(virDomainPtr domain)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
 
     conn = domain->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -12519,7 +12245,7 @@ virDomainAbortJob(virDomainPtr domain)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -12551,14 +12277,14 @@ virDomainMigrateSetMaxDowntime(virDomainPtr domain,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
 
     conn = domain->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -12568,7 +12294,7 @@ virDomainMigrateSetMaxDowntime(virDomainPtr domain,
         return 0;
     }
 
-    virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(conn);
     return -1;
@@ -12621,18 +12347,18 @@ virConnectDomainEventRegisterAny(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (dom != NULL &&
         !(VIR_IS_CONNECTED_DOMAIN(dom) && dom->conn == conn)) {
-        virLibConnError(conn, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(conn);
         return (-1);
     }
     if (eventID < 0 || eventID >= VIR_DOMAIN_EVENT_ID_LAST || cb == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -12644,7 +12370,7 @@ virConnectDomainEventRegisterAny(virConnectPtr conn,
         return ret;
     }
 
-    virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(conn);
     return -1;
@@ -12669,12 +12395,12 @@ virConnectDomainEventDeregisterAny(virConnectPtr conn,
     virResetLastError();
 
     if (!VIR_IS_CONNECT(conn)) {
-        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
         virDispatchError(NULL);
         return (-1);
     }
     if (callbackID < 0) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
     if ((conn->driver) && (conn->driver->domainEventDeregisterAny)) {
@@ -12685,7 +12411,7 @@ virConnectDomainEventDeregisterAny(virConnectPtr conn,
         return ret;
     }
 
-    virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(conn);
     return -1;
@@ -12715,14 +12441,14 @@ int virDomainManagedSave(virDomainPtr dom, unsigned int flags)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(dom)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
 
     conn = dom->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(dom, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -12735,7 +12461,7 @@ int virDomainManagedSave(virDomainPtr dom, unsigned int flags)
         return ret;
     }
 
-    virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -12763,7 +12489,7 @@ int virDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(dom)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
@@ -12779,7 +12505,7 @@ int virDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags)
         return ret;
     }
 
-    virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -12804,14 +12530,14 @@ int virDomainManagedSaveRemove(virDomainPtr dom, unsigned int flags)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(dom)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
 
     conn = dom->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(dom, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -12824,7 +12550,7 @@ int virDomainManagedSaveRemove(virDomainPtr dom, unsigned int flags)
         return ret;
     }
 
-    virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
@@ -12854,14 +12580,14 @@ virDomainSnapshotCreateXML(virDomainPtr domain,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return NULL;
     }
 
     conn = domain->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -12873,7 +12599,7 @@ virDomainSnapshotCreateXML(virDomainPtr domain,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(conn);
     return NULL;
@@ -12899,7 +12625,7 @@ virDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
     virResetLastError();
 
     if (!VIR_IS_DOMAIN_SNAPSHOT(snapshot)) {
-        virLibDomainSnapshotError(NULL, VIR_ERR_INVALID_DOMAIN_SNAPSHOT,
+        virLibDomainSnapshotError(VIR_ERR_INVALID_DOMAIN_SNAPSHOT,
                                   __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
@@ -12908,7 +12634,7 @@ virDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
     conn = snapshot->domain->conn;
 
     if ((conn->flags & VIR_CONNECT_RO) && (flags & VIR_DOMAIN_XML_SECURE)) {
-        virLibConnError(conn, VIR_ERR_OPERATION_DENIED,
+        virLibConnError(VIR_ERR_OPERATION_DENIED,
                         _("virDomainSnapshotGetXMLDesc with secure flag"));
         goto error;
     }
@@ -12921,7 +12647,7 @@ virDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(conn);
     return NULL;
@@ -12946,7 +12672,7 @@ virDomainSnapshotNum(virDomainPtr domain, unsigned int flags)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
@@ -12959,7 +12685,7 @@ virDomainSnapshotNum(virDomainPtr domain, unsigned int flags)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(conn);
     return -1;
@@ -12990,7 +12716,7 @@ virDomainSnapshotListNames(virDomainPtr domain, char **names, int nameslen,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
@@ -12998,7 +12724,7 @@ virDomainSnapshotListNames(virDomainPtr domain, char **names, int nameslen,
     conn = domain->conn;
 
     if ((names == NULL) || (nameslen < 0)) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -13010,7 +12736,7 @@ virDomainSnapshotListNames(virDomainPtr domain, char **names, int nameslen,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(conn);
     return -1;
@@ -13040,7 +12766,7 @@ virDomainSnapshotLookupByName(virDomainPtr domain,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
@@ -13048,7 +12774,7 @@ virDomainSnapshotLookupByName(virDomainPtr domain,
     conn = domain->conn;
 
     if (name == NULL) {
-        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
 
@@ -13060,7 +12786,7 @@ virDomainSnapshotLookupByName(virDomainPtr domain,
         return dom;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(conn);
     return NULL;
@@ -13085,7 +12811,7 @@ virDomainHasCurrentSnapshot(virDomainPtr domain, unsigned int flags)
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
@@ -13099,7 +12825,7 @@ virDomainHasCurrentSnapshot(virDomainPtr domain, unsigned int flags)
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(conn);
     return -1;
@@ -13127,7 +12853,7 @@ virDomainSnapshotCurrent(virDomainPtr domain,
     virResetLastError();
 
     if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return (NULL);
     }
@@ -13142,7 +12868,7 @@ virDomainSnapshotCurrent(virDomainPtr domain,
         return snap;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(conn);
     return NULL;
@@ -13168,7 +12894,7 @@ virDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
     virResetLastError();
 
     if (!VIR_IS_DOMAIN_SNAPSHOT(snapshot)) {
-        virLibDomainSnapshotError(NULL, VIR_ERR_INVALID_DOMAIN_SNAPSHOT,
+        virLibDomainSnapshotError(VIR_ERR_INVALID_DOMAIN_SNAPSHOT,
                                   __FUNCTION__);
         virDispatchError(NULL);
         return -1;
@@ -13183,7 +12909,7 @@ virDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(conn);
     return -1;
@@ -13214,7 +12940,7 @@ virDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
     virResetLastError();
 
     if (!VIR_IS_DOMAIN_SNAPSHOT(snapshot)) {
-        virLibDomainSnapshotError(NULL, VIR_ERR_INVALID_DOMAIN_SNAPSHOT,
+        virLibDomainSnapshotError(VIR_ERR_INVALID_DOMAIN_SNAPSHOT,
                                   __FUNCTION__);
         virDispatchError(NULL);
         return -1;
@@ -13229,7 +12955,7 @@ virDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
         return ret;
     }
 
-    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 error:
     virDispatchError(conn);
     return -1;
@@ -13252,7 +12978,7 @@ virDomainSnapshotFree(virDomainSnapshotPtr snapshot)
     virResetLastError();
 
     if (!VIR_IS_DOMAIN_SNAPSHOT(snapshot)) {
-        virLibDomainSnapshotError(NULL, VIR_ERR_INVALID_DOMAIN_SNAPSHOT,
+        virLibDomainSnapshotError(VIR_ERR_INVALID_DOMAIN_SNAPSHOT,
                                   __FUNCTION__);
         virDispatchError(NULL);
         return -1;
@@ -13293,14 +13019,14 @@ int virDomainOpenConsole(virDomainPtr dom,
     virResetLastError();
 
     if (!VIR_IS_DOMAIN(dom)) {
-        virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         virDispatchError(NULL);
         return -1;
     }
 
     conn = dom->conn;
     if (conn->flags & VIR_CONNECT_RO) {
-        virLibDomainError(dom, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
         goto error;
     }
 
@@ -13312,7 +13038,7 @@ int virDomainOpenConsole(virDomainPtr dom,
         return ret;
     }
 
-    virLibConnError(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
 
 error:
     virDispatchError(conn);
-- 
1.7.3.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]