]> xenbits.xensource.com Git - libvirt.git/commitdiff
Simplify the Xen domain get XML driver method
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 30 Apr 2013 16:26:30 +0000 (17:26 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 9 May 2013 12:16:20 +0000 (13:16 +0100)
The xenUnifiedDomainGetXMLDesc driver can assume that
the XM and XenD drivers are always present

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

index 7074c839e4078d51777dd68ce482aed09077914c..ea357173fd064a09138638f975a698fa97adc801 100644 (file)
@@ -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;
 }
 
 
index f93b74e5dca5bf691b4dff5e4f6bcd459f2a6f1e..609c5ab548db2edc4eeff1fd8ee52ae31f6c56e4 100644 (file)
@@ -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,