[PATCH 2/2] storage: Use virStorageBackendRefreshVolTargetUpdate after wipeVol

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

 



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

Rather than using refreshVol which essentially only updates the
allocation, capacity, and permissions for the volume, but not
the format which does get updated in a pool refresh - let's use
the same helper that pool refresh uses in order to update the
volume target.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/storage/storage_driver.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 8552120..7cf5943 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -2496,8 +2496,11 @@ storageVolWipePattern(virStorageVolPtr vol,
     if (backend->wipeVol(vol->conn, obj, voldef, algorithm, flags) < 0)
         goto cleanup;
 
-    if (backend->refreshVol &&
-        backend->refreshVol(vol->conn, obj, voldef) < 0)
+    /* Instead of using the refreshVol, since much changes on the target
+     * volume, let's update using the same function as refreshPool would
+     * use when it discovers a volume. The only failure to capture is -1,
+     * we can ignore -2. */
+    if (virStorageBackendRefreshVolTargetUpdate(voldef) == -1)
         goto cleanup;
 
     ret = 0;
-- 
2.9.5

--
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]
  Powered by Linux