From 970092dcde17d11d557616fe26be40c5f69e6d4f Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Tue, 30 Apr 2013 17:26:30 +0100 Subject: [PATCH] Simplify the Xen domain get XML driver method The xenUnifiedDomainGetXMLDesc driver can assume that the XM and XenD drivers are always present Signed-off-by: Daniel P. Berrange --- src/xen/xen_driver.c | 24 +++++++++--------------- src/xen/xend_internal.c | 6 ------ 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index 7074c839e4..ea357173fd 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -1117,23 +1117,17 @@ xenUnifiedDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) { xenUnifiedPrivatePtr priv = dom->conn->privateData; - if (dom->id == -1 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) { - if (priv->opened[XEN_UNIFIED_XM_OFFSET]) - return xenXMDomainGetXMLDesc(dom, flags); + if (dom->id < 0 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) { + return xenXMDomainGetXMLDesc(dom, flags); } else { - if (priv->opened[XEN_UNIFIED_XEND_OFFSET]) { - char *cpus, *res; - xenUnifiedLock(priv); - cpus = xenDomainUsedCpus(dom); - xenUnifiedUnlock(priv); - res = xenDaemonDomainGetXMLDesc(dom, flags, cpus); - VIR_FREE(cpus); - return res; - } + char *cpus, *res; + xenUnifiedLock(priv); + cpus = xenDomainUsedCpus(dom); + xenUnifiedUnlock(priv); + res = xenDaemonDomainGetXMLDesc(dom, flags, cpus); + VIR_FREE(cpus); + return res; } - - virReportError(VIR_ERR_NO_SUPPORT, __FUNCTION__); - return NULL; } diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c index f93b74e5dc..609c5ab548 100644 --- a/src/xen/xend_internal.c +++ b/src/xen/xend_internal.c @@ -1610,17 +1610,11 @@ xenDaemonDomainGetXMLDesc(virDomainPtr domain, unsigned int flags, const char *cpus) { - xenUnifiedPrivatePtr priv = domain->conn->privateData; virDomainDefPtr def; char *xml; /* Flags checked by virDomainDefFormat */ - if (domain->id < 0 && priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4) { - /* fall-through to the next driver to handle */ - return NULL; - } - if (!(def = xenDaemonDomainFetch(domain->conn, domain->id, domain->name,