提交 aead5166 编写于 作者: D Daniel P. Berrange

Simplify the Xen domain is persistent driver method

Unconditionally call xenDaemonLookupByUUID, since the XenD
driver must always be present.
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 e920c5b6
...@@ -702,29 +702,26 @@ xenUnifiedDomainIsPersistent(virDomainPtr dom) ...@@ -702,29 +702,26 @@ xenUnifiedDomainIsPersistent(virDomainPtr dom)
ret = 0; ret = 0;
} else { } else {
/* New Xen with inactive domain management */ /* New Xen with inactive domain management */
if (priv->opened[XEN_UNIFIED_XEND_OFFSET]) { currdom = xenDaemonLookupByUUID(dom->conn, dom->uuid);
currdom = xenDaemonLookupByUUID(dom->conn, dom->uuid); if (currdom) {
if (currdom) { if (currdom->id == -1) {
if (currdom->id == -1) { /* If its inactive, then trivially, it must be persistent */
/* If its inactive, then trivially, it must be persistent */ ret = 1;
ret = 1; } else {
} else { char *path;
char *path; char uuidstr[VIR_UUID_STRING_BUFLEN];
char uuidstr[VIR_UUID_STRING_BUFLEN];
/* If its running there's no official way to tell, so we
/* If its running there's no official way to tell, so we * go behind xend's back & look at the config dir */
* go behind xend's back & look at the config dir */ virUUIDFormat(dom->uuid, uuidstr);
if (virAsprintf(&path, "%s/%s", XEND_DOMAINS_DIR, uuidstr) < 0) {
virUUIDFormat(dom->uuid, uuidstr); virReportOOMError();
if (virAsprintf(&path, "%s/%s", XEND_DOMAINS_DIR, uuidstr) < 0) { goto done;
virReportOOMError();
goto done;
}
if (access(path, R_OK) == 0)
ret = 1;
else if (errno == ENOENT)
ret = 0;
} }
if (access(path, R_OK) == 0)
ret = 1;
else if (errno == ENOENT)
ret = 0;
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册