]> xenbits.xensource.com Git - libvirt.git/commitdiff
Simplify the Xen domain is persistent driver method
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 30 Apr 2013 14:12:47 +0000 (15:12 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 9 May 2013 12:16:19 +0000 (13:16 +0100)
Unconditionally call xenDaemonLookupByUUID, since the XenD
driver must always be present.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/xen/xen_driver.c

index b3a539dd47dd077ba12870bbdce3c7c1d70c6d63..f8eca48c1946aa3870dd37baeba3786b0e4e8802 100644 (file)
@@ -702,29 +702,26 @@ xenUnifiedDomainIsPersistent(virDomainPtr dom)
             ret = 0;
     } else {
         /* New Xen with inactive domain management */
-        if (priv->opened[XEN_UNIFIED_XEND_OFFSET]) {
-            currdom = xenDaemonLookupByUUID(dom->conn, dom->uuid);
-            if (currdom) {
-                if (currdom->id == -1) {
-                    /* If its inactive, then trivially, it must be persistent */
-                    ret = 1;
-                } else {
-                    char *path;
-                    char uuidstr[VIR_UUID_STRING_BUFLEN];
-
-                    /* If its running there's no official way to tell, so we
-                     * go behind xend's back & look at the config dir */
-
-                    virUUIDFormat(dom->uuid, uuidstr);
-                    if (virAsprintf(&path, "%s/%s", XEND_DOMAINS_DIR, uuidstr) < 0) {
-                        virReportOOMError();
-                        goto done;
-                    }
-                    if (access(path, R_OK) == 0)
-                        ret = 1;
-                    else if (errno == ENOENT)
-                        ret = 0;
+        currdom = xenDaemonLookupByUUID(dom->conn, dom->uuid);
+        if (currdom) {
+            if (currdom->id == -1) {
+                /* If its inactive, then trivially, it must be persistent */
+                ret = 1;
+            } else {
+                char *path;
+                char uuidstr[VIR_UUID_STRING_BUFLEN];
+
+                /* If its running there's no official way to tell, so we
+                 * go behind xend's back & look at the config dir */
+                virUUIDFormat(dom->uuid, uuidstr);
+                if (virAsprintf(&path, "%s/%s", XEND_DOMAINS_DIR, uuidstr) < 0) {
+                    virReportOOMError();
+                    goto done;
                 }
+                if (access(path, R_OK) == 0)
+                    ret = 1;
+                else if (errno == ENOENT)
+                    ret = 0;
             }
         }
     }