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

[libvirt] [PATCHv3 05/27] fix fallout in src/openvz



---
 src/openvz/openvz_conf.c   |  3 ++-
 src/openvz/openvz_conf.h   |  1 +
 src/openvz/openvz_driver.c | 16 ++++++++++------
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index fde32ce..f175655 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -558,6 +558,7 @@ openvzFreeDriver(struct openvz_driver *driver)
     if (!driver)
         return;

+    virObjectUnref(driver->xmlconf);
     virObjectUnref(driver->domains);
     virObjectUnref(driver->caps);
     VIR_FREE(driver);
@@ -648,7 +649,7 @@ int openvzLoadDomains(struct openvz_driver *driver) {
             flags |= VIR_DOMAIN_OBJ_LIST_ADD_LIVE;

         if (!(dom = virDomainObjListAdd(driver->domains,
-                                        driver->caps,
+                                        driver->xmlconf,
                                         def,
                                         flags,
                                         NULL)))
diff --git a/src/openvz/openvz_conf.h b/src/openvz/openvz_conf.h
index d7f21b3..a030b42 100644
--- a/src/openvz/openvz_conf.h
+++ b/src/openvz/openvz_conf.h
@@ -45,6 +45,7 @@ struct openvz_driver {
     virMutex lock;

     virCapsPtr caps;
+    virDomainXMLConfPtr xmlconf;
     virDomainObjListPtr domains;
     int version;
 };
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index 3865206..67d66ae 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -955,8 +955,8 @@ openvzDomainDefineXML(virConnectPtr conn, const char *xml)
     virDomainPtr dom = NULL;

     openvzDriverLock(driver);
-    if ((vmdef = virDomainDefParseString(driver->caps, xml,
-                                         1 << VIR_DOMAIN_VIRT_OPENVZ,
+    if ((vmdef = virDomainDefParseString(driver->caps, driver->xmlconf,
+                                         xml, 1 << VIR_DOMAIN_VIRT_OPENVZ,
                                          VIR_DOMAIN_XML_INACTIVE)) == NULL)
         goto cleanup;

@@ -968,7 +968,7 @@ openvzDomainDefineXML(virConnectPtr conn, const char *xml)
         goto cleanup;
     }
     if (!(vm = virDomainObjListAdd(driver->domains,
-                                   driver->caps,
+                                   driver->xmlconf,
                                    vmdef, 0, NULL)))
         goto cleanup;
     vmdef = NULL;
@@ -1042,8 +1042,8 @@ openvzDomainCreateXML(virConnectPtr conn, const char *xml,
     virCheckFlags(0, NULL);

     openvzDriverLock(driver);
-    if ((vmdef = virDomainDefParseString(driver->caps, xml,
-                                         1 << VIR_DOMAIN_VIRT_OPENVZ,
+    if ((vmdef = virDomainDefParseString(driver->caps, driver->xmlconf,
+                                         xml, 1 << VIR_DOMAIN_VIRT_OPENVZ,
                                          VIR_DOMAIN_XML_INACTIVE)) == NULL)
         goto cleanup;

@@ -1055,7 +1055,7 @@ openvzDomainCreateXML(virConnectPtr conn, const char *xml,
         goto cleanup;
     }
     if (!(vm = virDomainObjListAdd(driver->domains,
-                                   driver->caps,
+                                   driver->xmlconf,
                                    vmdef,
                                    VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
                                    NULL)))
@@ -1453,6 +1453,9 @@ static virDrvOpenStatus openvzOpen(virConnectPtr conn,
     if (!(driver->caps = openvzCapsInit()))
         goto cleanup;

+    if (!(driver->xmlconf = virDomainXMLConfNew(NULL, NULL)))
+        goto cleanup;
+
     if (openvzLoadDomains(driver) < 0)
         goto cleanup;

@@ -2076,6 +2079,7 @@ openvzDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml,
     }

     if (virDomainLiveConfigHelperMethod(driver->caps,
+                                        driver->xmlconf,
                                         vm,
                                         &flags,
                                         &vmdef) < 0)
-- 
1.8.1.5


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