[libvirt] [PATCHv3 03/27] fix fallout in src/esx

Peter Krempa pkrempa at redhat.com
Mon Mar 11 15:06:14 UTC 2013


---
 src/esx/esx_driver.c  | 14 ++++++++++----
 src/esx/esx_private.h |  2 ++
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index 046035d..fc8a3ae 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -71,6 +71,7 @@ esxFreePrivate(esxPrivate **priv)
     esxVI_Context_Free(&(*priv)->vCenter);
     esxUtil_FreeParsedUri(&(*priv)->parsedUri);
     virObjectUnref((*priv)->caps);
+    virObjectUnref((*priv)->xmlconf);
     VIR_FREE(*priv);
 }

@@ -1099,6 +1100,9 @@ esxOpen(virConnectPtr conn, virConnectAuthPtr auth,
         goto cleanup;
     }

+    if (!(priv->xmlconf = virDomainXMLConfNew(NULL, NULL)))
+        goto cleanup;
+
     conn->privateData = priv;
     priv = NULL;
     result = VIR_DRV_OPEN_SUCCESS;
@@ -2883,8 +2887,8 @@ esxDomainXMLToNative(virConnectPtr conn, const char *nativeFormat,
         return NULL;
     }

-    def = virDomainDefParseString(priv->caps, domainXml,
-                                  1 << VIR_DOMAIN_VIRT_VMWARE, 0);
+    def = virDomainDefParseString(priv->caps, priv->xmlconf,
+                                  domainXml, 1 << VIR_DOMAIN_VIRT_VMWARE, 0);

     if (def == NULL) {
         return NULL;
@@ -3099,7 +3103,8 @@ esxDomainDefineXML(virConnectPtr conn, const char *xml)
     }

     /* Parse domain XML */
-    def = virDomainDefParseString(priv->caps, xml, 1 << VIR_DOMAIN_VIRT_VMWARE,
+    def = virDomainDefParseString(priv->caps, priv->xmlconf,
+                                  xml, 1 << VIR_DOMAIN_VIRT_VMWARE,
                                   VIR_DOMAIN_XML_INACTIVE);

     if (def == NULL) {
@@ -4270,7 +4275,8 @@ esxDomainSnapshotCreateXML(virDomainPtr domain, const char *xmlDesc,
         return NULL;
     }

-    def = virDomainSnapshotDefParseString(xmlDesc, NULL, 0, 0);
+    def = virDomainSnapshotDefParseString(xmlDesc, priv->caps,
+                                          priv->xmlconf, 0, 0);

     if (def == NULL) {
         return NULL;
diff --git a/src/esx/esx_private.h b/src/esx/esx_private.h
index f1e7adf..2973130 100644
--- a/src/esx/esx_private.h
+++ b/src/esx/esx_private.h
@@ -26,6 +26,7 @@
 # include "internal.h"
 # include "virerror.h"
 # include "capabilities.h"
+# include "domain_conf.h"
 # include "esx_vi.h"

 typedef struct _esxPrivate {
@@ -34,6 +35,7 @@ typedef struct _esxPrivate {
     esxVI_Context *vCenter;
     esxUtil_ParsedUri *parsedUri;
     virCapsPtr caps;
+    virDomainXMLConfPtr xmlconf;
     int32_t maxVcpus;
     esxVI_Boolean supportsVMotion;
     esxVI_Boolean supportsLongMode; /* aka x86_64 */
-- 
1.8.1.5




More information about the libvir-list mailing list