[libvirt] [PATCH] Fix reading storage pool defs on driver startup

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

 



The recent storage refactoring I committed broke reading pool
definitions from disk on driver startup: the result was that none of
your pools would be defined. Frankly not sure how I managed to miss the
brokenness, sorry about that!

Also refactor the startup code to match the existing network and domain
conventions.

Thanks,
Cole
diff --git a/src/storage_conf.c b/src/storage_conf.c
index 63bc6df..493eaa7 100644
--- a/src/storage_conf.c
+++ b/src/storage_conf.c
@@ -1391,12 +1391,11 @@ virStoragePoolObjLoad(virConnectPtr conn,
                       virStoragePoolObjListPtr pools,
                       const char *file,
                       const char *path,
-                      const char *xml,
                       const char *autostartLink) {
     virStoragePoolDefPtr def;
     virStoragePoolObjPtr pool;
 
-    if (!(def = virStoragePoolDefParse(NULL, xml, file))) {
+    if (!(def = virStoragePoolDefParseFile(conn, path))) {
         return NULL;
     }
 
@@ -1450,7 +1449,6 @@ virStoragePoolLoadAllConfigs(virConnectPtr conn,
     }
 
     while ((entry = readdir(dir))) {
-        char *xml = NULL;
         char path[PATH_MAX];
         char autostartLink[PATH_MAX];
         virStoragePoolObjPtr pool;
@@ -1477,14 +1475,10 @@ virStoragePoolLoadAllConfigs(virConnectPtr conn,
             continue;
         }
 
-        if (virFileReadAll(path, 8192, &xml) < 0)
-            continue;
-
-        pool = virStoragePoolObjLoad(conn, pools, entry->d_name, path, xml, autostartLink);
+        pool = virStoragePoolObjLoad(conn, pools, entry->d_name, path,
+                                     autostartLink);
         if (pool)
             virStoragePoolObjUnlock(pool);
-
-        VIR_FREE(xml);
     }
 
     closedir(dir);
--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]