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

[libvirt] [PATCHv2 10/21] fix fallout in src/xen



---
 src/xen/xen_driver.c    | 8 ++++++--
 src/xen/xen_driver.h    | 1 +
 src/xen/xend_internal.c | 8 ++++----
 src/xen/xm_internal.c   | 2 +-
 4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index d896893..fd20b73 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -401,6 +401,9 @@ xenUnifiedOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags)
         goto fail;
     }

+    if (!(priv->xmlconf = virDomainXMLConfNew(NULL, NULL)))
+        goto fail;
+
 #if WITH_XEN_INOTIFY
     if (xenHavePrivilege()) {
         VIR_DEBUG("Trying Xen inotify sub-driver");
@@ -448,6 +451,7 @@ xenUnifiedClose(virConnectPtr conn)
     int i;

     virObjectUnref(priv->caps);
+    virObjectUnref(priv->xmlconf);
     virDomainEventStateFree(priv->domainEvents);

     for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
@@ -1430,8 +1434,8 @@ xenUnifiedDomainXMLToNative(virConnectPtr conn,
         goto cleanup;
     }

-    if (!(def = virDomainDefParseString(priv->caps, xmlData,
-                                        1 << VIR_DOMAIN_VIRT_XEN, 0)))
+    if (!(def = virDomainDefParseString(priv->caps, priv->xmlconf,
+                                        xmlData, 1 << VIR_DOMAIN_VIRT_XEN, 0)))
         goto cleanup;

     if (STREQ(format, XEN_CONFIG_FORMAT_XM)) {
diff --git a/src/xen/xen_driver.h b/src/xen/xen_driver.h
index 078980e..8e43db3 100644
--- a/src/xen/xen_driver.h
+++ b/src/xen/xen_driver.h
@@ -160,6 +160,7 @@ struct _xenUnifiedPrivate {
      * holding the lock
      */
     virCapsPtr caps;
+    virDomainXMLConfPtr xmlconf;
     int handle;			/* Xen hypervisor handle */

     int xendConfigVersion;      /* XenD config version */
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index 27b87fc..aa2f725 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -2409,8 +2409,8 @@ xenDaemonCreateXML(virConnectPtr conn, const char *xmlDesc, unsigned int flags)

     virCheckFlags(0, NULL);

-    if (!(def = virDomainDefParseString(priv->caps, xmlDesc,
-                                        1 << VIR_DOMAIN_VIRT_XEN,
+    if (!(def = virDomainDefParseString(priv->caps, priv->xmlconf,
+                                        xmlDesc, 1 << VIR_DOMAIN_VIRT_XEN,
                                         VIR_DOMAIN_XML_INACTIVE)))
         return NULL;

@@ -3127,8 +3127,8 @@ xenDaemonDomainDefineXML(virConnectPtr conn, const char *xmlDesc)
     if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
         return NULL;

-    if (!(def = virDomainDefParseString(priv->caps, xmlDesc,
-                                        1 << VIR_DOMAIN_VIRT_XEN,
+    if (!(def = virDomainDefParseString(priv->caps, priv->xmlconf,
+                                        xmlDesc, 1 << VIR_DOMAIN_VIRT_XEN,
                                         VIR_DOMAIN_XML_INACTIVE))) {
         virReportError(VIR_ERR_XML_ERROR,
                        "%s", _("failed to parse domain description"));
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index dfc8bf6..f6a3593 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -1013,7 +1013,7 @@ xenXMDomainDefineXML(virConnectPtr conn, const char *xml)
         return NULL;
     }

-    if (!(def = virDomainDefParseString(priv->caps, xml,
+    if (!(def = virDomainDefParseString(priv->caps, priv->xmlconf, xml,
                                         1 << VIR_DOMAIN_VIRT_XEN,
                                         VIR_DOMAIN_XML_INACTIVE))) {
         xenUnifiedUnlock(priv);
-- 
1.8.1.1


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