[PATCH 11/40] Simplify the Xen domain is persistent driver method

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

Unconditionally call xenDaemonLookupByUUID, since the XenD
driver must always be present.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 src/xen/xen_driver.c | 41 +++++++++++++++++++----------------------
 1 file changed, 19 insertions(+), 22 deletions(-)

diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 080045c..5f296ad 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -691,29 +691,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;
             }
         }
     }
-- 
1.8.1.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]