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

[libvirt] [PATCH 22/30] uml: Remove virConnectPtr from umlReportError



---
 src/uml/uml_conf.c   |   38 ++++++-------
 src/uml/uml_conf.h   |    4 +-
 src/uml/uml_driver.c |  149 ++++++++++++++++++++++++--------------------------
 3 files changed, 92 insertions(+), 99 deletions(-)

diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
index 17f4e2e..8e075ff 100644
--- a/src/uml/uml_conf.c
+++ b/src/uml/uml_conf.c
@@ -97,8 +97,7 @@ virCapsPtr umlCapsInit(void) {
 
 
 static int
-umlConnectTapDevice(virConnectPtr conn,
-                    virDomainNetDefPtr net,
+umlConnectTapDevice(virDomainNetDefPtr net,
                     const char *bridge)
 {
     brControl *brctl = NULL;
@@ -126,7 +125,7 @@ umlConnectTapDevice(virConnectPtr conn,
                         &net->ifname, BR_TAP_PERSIST, &tapfd))) {
         if (errno == ENOTSUP) {
             /* In this particular case, give a better diagnostic. */
-            umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+            umlReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to add tap interface to bridge. "
                              "%s is not a bridge device"), bridge);
         } else if (template_ifname) {
@@ -176,24 +175,24 @@ umlBuildCommandLineNet(virConnectPtr conn,
         /* ethNNN=tuntap,tapname,macaddr,gateway */
         virBufferAddLit(&buf, "tuntap");
         if (def->data.ethernet.ipaddr) {
-            umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
+            umlReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                            _("IP address not supported for ethernet inteface"));
             goto error;
         }
         if (def->data.ethernet.script) {
-            umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
+            umlReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                            _("script execution not supported for ethernet inteface"));
             goto error;
         }
         break;
 
     case VIR_DOMAIN_NET_TYPE_SERVER:
-        umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
+        umlReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("TCP server networking type not supported"));
         goto error;
 
     case VIR_DOMAIN_NET_TYPE_CLIENT:
-        umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
+        umlReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("TCP client networking type not supported"));
         goto error;
 
@@ -208,7 +207,7 @@ umlBuildCommandLineNet(virConnectPtr conn,
         virNetworkPtr network = virNetworkLookupByName(conn,
                                                        def->data.network.name);
         if (!network) {
-            umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+            umlReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Network '%s' not found"),
                            def->data.network.name);
             goto error;
@@ -219,7 +218,7 @@ umlBuildCommandLineNet(virConnectPtr conn,
             goto error;
         }
 
-        if (umlConnectTapDevice(conn, def, bridge) < 0) {
+        if (umlConnectTapDevice(def, bridge) < 0) {
             VIR_FREE(bridge);
             goto error;
         }
@@ -230,7 +229,7 @@ umlBuildCommandLineNet(virConnectPtr conn,
     }
 
     case VIR_DOMAIN_NET_TYPE_BRIDGE:
-        if (umlConnectTapDevice(conn, def, def->data.bridge.brname) < 0)
+        if (umlConnectTapDevice(def, def->data.bridge.brname) < 0)
             goto error;
 
         /* ethNNN=tuntap,tapname,macaddr,gateway */
@@ -238,12 +237,12 @@ umlBuildCommandLineNet(virConnectPtr conn,
         break;
 
     case VIR_DOMAIN_NET_TYPE_INTERNAL:
-        umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
+        umlReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("internal networking type not supported"));
         goto error;
 
     case VIR_DOMAIN_NET_TYPE_DIRECT:
-        umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
+        umlReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("direct networking type not supported"));
         goto error;
 
@@ -274,8 +273,7 @@ error:
 }
 
 static char *
-umlBuildCommandLineChr(virConnectPtr conn,
-                       virDomainChrDefPtr def,
+umlBuildCommandLineChr(virDomainChrDefPtr def,
                        const char *dev)
 {
     char *ret = NULL;
@@ -312,8 +310,8 @@ umlBuildCommandLineChr(virConnectPtr conn,
 
     case VIR_DOMAIN_CHR_TYPE_TCP:
         if (def->data.tcp.listen != 1) {
-            umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
-                           "%s", _("only TCP listen is supported for chr device"));
+            umlReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                           _("only TCP listen is supported for chr device"));
             return NULL;
         }
 
@@ -332,7 +330,7 @@ umlBuildCommandLineChr(virConnectPtr conn,
     case VIR_DOMAIN_CHR_TYPE_UDP:
     case VIR_DOMAIN_CHR_TYPE_UNIX:
     default:
-        umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+        umlReportError(VIR_ERR_INTERNAL_ERROR,
                        _("unsupported chr device type %d"), def->type);
         break;
     }
@@ -476,7 +474,7 @@ int umlBuildCommandLine(virConnectPtr conn,
         virDomainDiskDefPtr disk = vm->def->disks[i];
 
         if (!STRPREFIX(disk->dst, "ubd")) {
-            umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+            umlReportError(VIR_ERR_INTERNAL_ERROR,
                            _("unsupported disk type '%s'"), disk->dst);
             goto error;
         }
@@ -494,7 +492,7 @@ int umlBuildCommandLine(virConnectPtr conn,
     for (i = 0 ; i < UML_MAX_CHAR_DEVICE ; i++) {
         char *ret;
         if (i == 0 && vm->def->console)
-            ret = umlBuildCommandLineChr(conn, vm->def->console, "con");
+            ret = umlBuildCommandLineChr(vm->def->console, "con");
         else
             if (virAsprintf(&ret, "con%d=none", i) < 0)
                 goto no_memory;
@@ -508,7 +506,7 @@ int umlBuildCommandLine(virConnectPtr conn,
             if (vm->def->serials[j]->target.port == i)
                 chr = vm->def->serials[j];
         if (chr)
-            ret = umlBuildCommandLineChr(conn, chr, "ssl");
+            ret = umlBuildCommandLineChr(chr, "ssl");
         else
             if (virAsprintf(&ret, "ssl%d=none", i) < 0)
                 goto no_memory;
diff --git a/src/uml/uml_conf.h b/src/uml/uml_conf.h
index 4d434e1..b33acc8 100644
--- a/src/uml/uml_conf.h
+++ b/src/uml/uml_conf.h
@@ -62,8 +62,8 @@ struct uml_driver {
 };
 
 
-# define umlReportError(conn, dom, net, code, ...)                       \
-    virReportErrorHelper(conn, VIR_FROM_UML, code, __FILE__,            \
+# define umlReportError(code, ...)                                      \
+    virReportErrorHelper(NULL, VIR_FROM_UML, code, __FILE__,            \
                          __FUNCTION__, __LINE__, __VA_ARGS__)
 
 virCapsPtr  umlCapsInit               (void);
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 58ffe68..822d398 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -106,8 +106,7 @@ static void umlDriverUnlock(struct uml_driver *driver)
 }
 
 
-static int umlOpenMonitor(virConnectPtr conn,
-                          struct uml_driver *driver,
+static int umlOpenMonitor(struct uml_driver *driver,
                           virDomainObjPtr vm);
 static int umlReadPidFile(struct uml_driver *driver,
                           virDomainObjPtr vm);
@@ -134,11 +133,10 @@ static void umlShutdownVMDaemon(virConnectPtr conn,
                                 virDomainObjPtr vm);
 
 
-static int umlMonitorCommand (virConnectPtr conn,
-                              const struct uml_driver *driver,
-                              const virDomainObjPtr vm,
-                              const char *cmd,
-                              char **reply);
+static int umlMonitorCommand(const struct uml_driver *driver,
+                             const virDomainObjPtr vm,
+                             const char *cmd,
+                             char **reply);
 
 static struct uml_driver *uml_driver = NULL;
 
@@ -201,7 +199,7 @@ umlIdentifyOneChrPTY(struct uml_driver *driver,
         return -1;
     }
 requery:
-    if (umlMonitorCommand(NULL, driver, dom, cmd, &res) < 0)
+    if (umlMonitorCommand(driver, dom, cmd, &res) < 0)
         return -1;
 
     if (res && STRPREFIX(res, "pts:")) {
@@ -320,7 +318,7 @@ reread:
             dom->def->id = driver->nextvmid++;
             dom->state = VIR_DOMAIN_RUNNING;
 
-            if (umlOpenMonitor(NULL, driver, dom) < 0) {
+            if (umlOpenMonitor(driver, dom) < 0) {
                 VIR_WARN0("Could not open monitor for new domain");
                 umlShutdownVMDaemon(NULL, driver, dom);
             } else if (umlIdentifyChrPTY(driver, dom) < 0) {
@@ -601,8 +599,7 @@ reopen:
     return rc;
 }
 
-static int umlMonitorAddress(virConnectPtr conn,
-                             const struct uml_driver *driver,
+static int umlMonitorAddress(const struct uml_driver *driver,
                              virDomainObjPtr vm,
                              struct sockaddr_un *addr) {
     char *sockname;
@@ -617,7 +614,7 @@ static int umlMonitorAddress(virConnectPtr conn,
     memset(addr, 0, sizeof *addr);
     addr->sun_family = AF_UNIX;
     if (virStrcpyStatic(addr->sun_path, sockname) == NULL) {
-        umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+        umlReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Unix path %s too long for destination"), sockname);
         retval = -1;
     }
@@ -625,15 +622,14 @@ static int umlMonitorAddress(virConnectPtr conn,
     return retval;
 }
 
-static int umlOpenMonitor(virConnectPtr conn,
-                          struct uml_driver *driver,
+static int umlOpenMonitor(struct uml_driver *driver,
                           virDomainObjPtr vm) {
     struct sockaddr_un addr;
     struct stat sb;
     int retries = 0;
     umlDomainObjPrivatePtr priv = vm->privateData;
 
-    if (umlMonitorAddress(conn, driver, vm, &addr) < 0)
+    if (umlMonitorAddress(driver, vm, &addr) < 0)
         return -1;
 
     VIR_DEBUG("Dest address for monitor is '%s'", addr.sun_path);
@@ -687,8 +683,7 @@ struct monitor_response {
 };
 
 
-static int umlMonitorCommand(virConnectPtr conn,
-                             const struct uml_driver *driver,
+static int umlMonitorCommand(const struct uml_driver *driver,
                              const virDomainObjPtr vm,
                              const char *cmd,
                              char **reply)
@@ -705,7 +700,7 @@ static int umlMonitorCommand(virConnectPtr conn,
 
     *reply = NULL;
 
-    if (umlMonitorAddress(conn, driver, vm, &addr) < 0)
+    if (umlMonitorAddress(driver, vm, &addr) < 0)
         return -1;
 
     memset(&req, 0, sizeof(req));
@@ -719,7 +714,7 @@ static int umlMonitorCommand(virConnectPtr conn,
         return -1;
     }
     if (virStrcpyStatic(req.data, cmd) == NULL) {
-        umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+        umlReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Command %s too long for destination"), cmd);
         return -1;
     }
@@ -826,14 +821,14 @@ static int umlStartVMDaemon(virConnectPtr conn,
     FD_ZERO(&keepfd);
 
     if (virDomainObjIsActive(vm)) {
-        umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
-                         "%s", _("VM is already active"));
+        umlReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                       _("VM is already active"));
         return -1;
     }
 
     if (!vm->def->os.kernel) {
-        umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
-                       "%s", _("no kernel specified"));
+        umlReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                       _("no kernel specified"));
         return -1;
     }
     /* Make sure the binary we are about to try exec'ing exists.
@@ -999,14 +994,14 @@ static virDrvOpenStatus umlOpen(virConnectPtr conn,
         if (uml_driver->privileged) {
             if (STRNEQ (conn->uri->path, "/system") &&
                 STRNEQ (conn->uri->path, "/session")) {
-                umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+                umlReportError(VIR_ERR_INTERNAL_ERROR,
                                _("unexpected UML URI path '%s', try uml:///system"),
                                conn->uri->path);
                 return VIR_DRV_OPEN_ERROR;
             }
         } else {
             if (STRNEQ (conn->uri->path, "/session")) {
-                umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+                umlReportError(VIR_ERR_INTERNAL_ERROR,
                                _("unexpected UML URI path '%s', try uml:///session"),
                                conn->uri->path);
                 return VIR_DRV_OPEN_ERROR;
@@ -1015,7 +1010,7 @@ static virDrvOpenStatus umlOpen(virConnectPtr conn,
 
         /* URI was good, but driver isn't active */
         if (uml_driver == NULL) {
-            umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
+            umlReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                            _("uml state driver is not active"));
             return VIR_DRV_OPEN_ERROR;
         }
@@ -1115,7 +1110,7 @@ static virDomainPtr umlDomainLookupByID(virConnectPtr conn,
     umlDriverUnlock(driver);
 
     if (!vm) {
-        umlReportError(conn, NULL, NULL, VIR_ERR_NO_DOMAIN, NULL);
+        umlReportError(VIR_ERR_NO_DOMAIN, NULL);
         goto cleanup;
     }
 
@@ -1139,7 +1134,7 @@ static virDomainPtr umlDomainLookupByUUID(virConnectPtr conn,
     umlDriverUnlock(driver);
 
     if (!vm) {
-        umlReportError(conn, NULL, NULL, VIR_ERR_NO_DOMAIN, NULL);
+        umlReportError(VIR_ERR_NO_DOMAIN, NULL);
         goto cleanup;
     }
 
@@ -1163,7 +1158,7 @@ static virDomainPtr umlDomainLookupByName(virConnectPtr conn,
     umlDriverUnlock(driver);
 
     if (!vm) {
-        umlReportError(conn, NULL, NULL, VIR_ERR_NO_DOMAIN, NULL);
+        umlReportError(VIR_ERR_NO_DOMAIN, NULL);
         goto cleanup;
     }
 
@@ -1187,7 +1182,7 @@ static int umlDomainIsActive(virDomainPtr dom)
     obj = virDomainFindByUUID(&driver->domains, dom->uuid);
     umlDriverUnlock(driver);
     if (!obj) {
-        umlReportError(dom->conn, NULL, NULL, VIR_ERR_NO_DOMAIN, NULL);
+        umlReportError(VIR_ERR_NO_DOMAIN, NULL);
         goto cleanup;
     }
     ret = virDomainObjIsActive(obj);
@@ -1209,7 +1204,7 @@ static int umlDomainIsPersistent(virDomainPtr dom)
     obj = virDomainFindByUUID(&driver->domains, dom->uuid);
     umlDriverUnlock(driver);
     if (!obj) {
-        umlReportError(dom->conn, NULL, NULL, VIR_ERR_NO_DOMAIN, NULL);
+        umlReportError(VIR_ERR_NO_DOMAIN, NULL);
         goto cleanup;
     }
     ret = obj->persistent;
@@ -1232,7 +1227,7 @@ static int umlGetVersion(virConnectPtr conn, unsigned long *version) {
         uname(&ut);
 
         if (virParseVersionString(ut.release, &driver->umlVersion) < 0) {
-            umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+            umlReportError(VIR_ERR_INTERNAL_ERROR,
                            _("cannot parse version %s"), ut.release);
             goto cleanup;
         }
@@ -1316,15 +1311,15 @@ static int umlDomainShutdown(virDomainPtr dom) {
     vm = virDomainFindByID(&driver->domains, dom->id);
     umlDriverUnlock(driver);
     if (!vm) {
-        umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
-                         _("no domain with matching id %d"), dom->id);
+        umlReportError(VIR_ERR_INVALID_DOMAIN,
+                       _("no domain with matching id %d"), dom->id);
         goto cleanup;
     }
 
 #if 0
     if (umlMonitorCommand(driver, vm, "system_powerdown", &info) < 0) {
-        umlReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
-                         "%s", _("shutdown operation failed"));
+        umlReportError(VIR_ERR_OPERATION_FAILED, "%s",
+                       _("shutdown operation failed"));
         goto cleanup;
     }
     ret = 0;
@@ -1346,8 +1341,8 @@ static int umlDomainDestroy(virDomainPtr dom) {
     umlDriverLock(driver);
     vm = virDomainFindByID(&driver->domains, dom->id);
     if (!vm) {
-        umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
-                         _("no domain with matching id %d"), dom->id);
+        umlReportError(VIR_ERR_INVALID_DOMAIN,
+                       _("no domain with matching id %d"), dom->id);
         goto cleanup;
     }
 
@@ -1376,8 +1371,8 @@ static char *umlDomainGetOSType(virDomainPtr dom) {
     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
     umlDriverUnlock(driver);
     if (!vm) {
-        umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
-                         "%s", _("no domain with matching uuid"));
+        umlReportError(VIR_ERR_INVALID_DOMAIN, "%s",
+                       _("no domain with matching uuid"));
         goto cleanup;
     }
 
@@ -1404,7 +1399,7 @@ static unsigned long umlDomainGetMaxMemory(virDomainPtr dom) {
         char uuidstr[VIR_UUID_STRING_BUFLEN];
 
         virUUIDFormat(dom->uuid, uuidstr);
-        umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+        umlReportError(VIR_ERR_INVALID_DOMAIN,
                        _("no domain with matching uuid '%s'"), uuidstr);
         goto cleanup;
     }
@@ -1429,14 +1424,14 @@ static int umlDomainSetMaxMemory(virDomainPtr dom, unsigned long newmax) {
         char uuidstr[VIR_UUID_STRING_BUFLEN];
 
         virUUIDFormat(dom->uuid, uuidstr);
-        umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
-                         _("no domain with matching uuid '%s'"), uuidstr);
+        umlReportError(VIR_ERR_INVALID_DOMAIN,
+                       _("no domain with matching uuid '%s'"), uuidstr);
         goto cleanup;
     }
 
     if (newmax < vm->def->memory) {
-        umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
-                         "%s", _("cannot set max memory lower than current memory"));
+        umlReportError(VIR_ERR_INVALID_ARG, "%s",
+                       _("cannot set max memory lower than current memory"));
         goto cleanup;
     }
 
@@ -1462,20 +1457,20 @@ static int umlDomainSetMemory(virDomainPtr dom, unsigned long newmem) {
         char uuidstr[VIR_UUID_STRING_BUFLEN];
 
         virUUIDFormat(dom->uuid, uuidstr);
-        umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
-                         _("no domain with matching uuid '%s'"), uuidstr);
+        umlReportError(VIR_ERR_INVALID_DOMAIN,
+                       _("no domain with matching uuid '%s'"), uuidstr);
         goto cleanup;
     }
 
     if (virDomainObjIsActive(vm)) {
-        umlReportError(dom->conn, dom, NULL, VIR_ERR_NO_SUPPORT,
-                         "%s", _("cannot set memory of an active domain"));
+        umlReportError(VIR_ERR_NO_SUPPORT, "%s",
+                       _("cannot set memory of an active domain"));
         goto cleanup;
     }
 
     if (newmem > vm->def->maxmem) {
-        umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
-                         "%s", _("cannot set memory higher than max memory"));
+        umlReportError(VIR_ERR_INVALID_ARG, "%s",
+                       _("cannot set memory higher than max memory"));
         goto cleanup;
     }
 
@@ -1499,8 +1494,8 @@ static int umlDomainGetInfo(virDomainPtr dom,
     umlDriverUnlock(driver);
 
     if (!vm) {
-        umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
-                       "%s", _("no domain with matching uuid"));
+        umlReportError(VIR_ERR_INVALID_DOMAIN, "%s",
+                       _("no domain with matching uuid"));
         goto cleanup;
     }
 
@@ -1510,8 +1505,8 @@ static int umlDomainGetInfo(virDomainPtr dom,
         info->cpuTime = 0;
     } else {
         if (umlGetProcessInfo(&(info->cpuTime), vm->pid) < 0) {
-            umlReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
-                           "%s", _("cannot read cputime for domain"));
+            umlReportError(VIR_ERR_OPERATION_FAILED, "%s",
+                           _("cannot read cputime for domain"));
             goto cleanup;
         }
     }
@@ -1539,8 +1534,8 @@ static char *umlDomainDumpXML(virDomainPtr dom,
     umlDriverUnlock(driver);
 
     if (!vm) {
-        umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
-                         "%s", _("no domain with matching uuid"));
+        umlReportError(VIR_ERR_INVALID_DOMAIN, "%s",
+                       _("no domain with matching uuid"));
         goto cleanup;
     }
 
@@ -1588,8 +1583,8 @@ static int umlDomainStart(virDomainPtr dom) {
     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
 
     if (!vm) {
-        umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
-                         "%s", _("no domain with matching uuid"));
+        umlReportError(VIR_ERR_INVALID_DOMAIN, "%s",
+                       _("no domain with matching uuid"));
         goto cleanup;
     }
 
@@ -1651,20 +1646,20 @@ static int umlDomainUndefine(virDomainPtr dom) {
     umlDriverLock(driver);
     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
     if (!vm) {
-        umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
-                         "%s", _("no domain with matching uuid"));
+        umlReportError(VIR_ERR_INVALID_DOMAIN, "%s",
+                       _("no domain with matching uuid"));
         goto cleanup;
     }
 
     if (virDomainObjIsActive(vm)) {
-        umlReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
-                         "%s", _("cannot delete active domain"));
+        umlReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                       _("cannot delete active domain"));
         goto cleanup;
     }
 
     if (!vm->persistent) {
-        umlReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
-                         "%s", _("cannot undefine transient domain"));
+        umlReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                       _("cannot undefine transient domain"));
         goto cleanup;
     }
 
@@ -1695,8 +1690,8 @@ static int umlDomainGetAutostart(virDomainPtr dom,
     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
 
     if (!vm) {
-        umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
-                         "%s", _("no domain with matching uuid"));
+        umlReportError(VIR_ERR_INVALID_DOMAIN, "%s",
+                       _("no domain with matching uuid"));
         goto cleanup;
     }
 
@@ -1721,14 +1716,14 @@ static int umlDomainSetAutostart(virDomainPtr dom,
     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
 
     if (!vm) {
-        umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
-                         "%s", _("no domain with matching uuid"));
+        umlReportError(VIR_ERR_INVALID_DOMAIN, "%s",
+                       _("no domain with matching uuid"));
         goto cleanup;
     }
 
     if (!vm->persistent) {
-        umlReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
-                         "%s", _("cannot set autostart for transient domain"));
+        umlReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                       _("cannot set autostart for transient domain"));
         goto cleanup;
     }
 
@@ -1795,14 +1790,14 @@ umlDomainBlockPeek (virDomainPtr dom,
     umlDriverUnlock(driver);
 
     if (!vm) {
-        umlReportError (dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
-                        "%s", _("no domain with matching uuid"));
+        umlReportError(VIR_ERR_INVALID_DOMAIN, "%s",
+                       _("no domain with matching uuid"));
         goto cleanup;
     }
 
     if (!path || path[0] == '\0') {
-        umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
-                       "%s", _("NULL or empty path"));
+        umlReportError(VIR_ERR_INVALID_ARG, "%s",
+                       _("NULL or empty path"));
         goto cleanup;
     }
 
@@ -1838,8 +1833,8 @@ umlDomainBlockPeek (virDomainPtr dom,
 
         ret = 0;
     } else {
-        umlReportError (dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
-                        "%s", _("invalid path"));
+        umlReportError(VIR_ERR_INVALID_ARG, "%s",
+                       _("invalid path"));
     }
 
 cleanup:
-- 
1.6.3.3


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