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

[libvirt] [PATCH 09/40] Simplify the Xen domain create driver method



From: "Daniel P. Berrange" <berrange redhat com>

Unconditionally call xenDaemonCreateXML in the
xenUnifiedDomainCreateXML driver, since the XenD
driver is always present.

Signed-off-by: Daniel P. Berrange <berrange redhat com>
---
 src/xen/xen_driver.c    | 6 ++----
 src/xen/xend_internal.c | 4 +---
 src/xen/xend_internal.h | 3 +--
 3 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 25fb7bb..82058b7 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -596,11 +596,9 @@ static virDomainPtr
 xenUnifiedDomainCreateXML(virConnectPtr conn,
                           const char *xmlDesc, unsigned int flags)
 {
-    xenUnifiedPrivatePtr priv = conn->privateData;
+    virCheckFlags(0, NULL);
 
-    if (priv->opened[XEN_UNIFIED_XEND_OFFSET])
-        return xenDaemonCreateXML(conn, xmlDesc, flags);
-    return NULL;
+    return xenDaemonCreateXML(conn, xmlDesc);
 }
 
 /* Assumption made in underlying drivers:
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index 952eb3f..2e6a47e 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -2288,7 +2288,7 @@ xenDaemonLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
  * Returns a new domain object or NULL in case of failure
  */
 virDomainPtr
-xenDaemonCreateXML(virConnectPtr conn, const char *xmlDesc, unsigned int flags)
+xenDaemonCreateXML(virConnectPtr conn, const char *xmlDesc)
 {
     int ret;
     char *sexpr;
@@ -2296,8 +2296,6 @@ xenDaemonCreateXML(virConnectPtr conn, const char *xmlDesc, unsigned int flags)
     xenUnifiedPrivatePtr priv = conn->privateData;
     virDomainDefPtr def;
 
-    virCheckFlags(0, NULL);
-
     if (!(def = virDomainDefParseString(xmlDesc, priv->caps, priv->xmlopt,
                                         1 << VIR_DOMAIN_VIRT_XEN,
                                         VIR_DOMAIN_XML_INACTIVE)))
diff --git a/src/xen/xend_internal.h b/src/xen/xend_internal.h
index f6760a2..5f82f04 100644
--- a/src/xen/xend_internal.h
+++ b/src/xen/xend_internal.h
@@ -152,8 +152,7 @@ int xenDaemonDomainSetAutostart          (virDomainPtr domain,
 extern struct xenUnifiedDriver xenDaemonDriver;
 int xenDaemonInit (void);
 
-virDomainPtr xenDaemonCreateXML(virConnectPtr conn, const char *xmlDesc,
-                                unsigned int flags);
+virDomainPtr xenDaemonCreateXML(virConnectPtr conn, const char *xmlDesc);
 virDomainPtr xenDaemonLookupByID(virConnectPtr conn, int id);
 virDomainPtr xenDaemonLookupByUUID(virConnectPtr conn, const unsigned char *uuid);
 virDomainPtr xenDaemonLookupByName(virConnectPtr conn, const char *domname);
-- 
1.8.1.4


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