[PATCH] storage: Refresh pool after creating volume

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

 



https://bugzilla.redhat.com/show_bug.cgi?id=965442

One has to refresh the pool to get the correct pool info, this
patch refreshes the pool after creating a volume in code instead.
Pool refreshing failure is fine to ignore with a warning.
---
 src/storage/storage_driver.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index a2b0c21..2a55095 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -1443,6 +1443,9 @@ storageVolCreateXML(virStoragePoolPtr obj,
 
     }
 
+    if (backend->refreshPool && backend->refreshPool(obj->conn, pool) < 0)
+        VIR_WARN("Failed to refresh pool after creating volume");
+
     VIR_INFO("Creating volume '%s' in storage pool '%s'",
              volobj->name, pool->def->name);
     ret = volobj;
@@ -1606,6 +1609,9 @@ storageVolCreateXMLFrom(virStoragePoolPtr obj,
         goto cleanup;
     }
 
+    if (backend->refreshPool && backend->refreshPool(obj->conn, pool) < 0)
+        VIR_WARN("Failed to refresh pool after creating volume");
+
     VIR_INFO("Creating volume '%s' in storage pool '%s'",
              volobj->name, pool->def->name);
     ret = volobj;
-- 
1.8.1.4

--
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]