]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: Use virStorageBackendRefreshVolTargetUpdate after wipeVol
authorJohn Ferlan <jferlan@redhat.com>
Thu, 24 Aug 2017 22:19:14 +0000 (18:19 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 30 Aug 2017 19:32:13 +0000 (15:32 -0400)
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.

src/storage/storage_driver.c

index 855212063b01724a98d89c1de2f0c667a8bbb999..7cf5943cb68d7aeadea116cf2c4d18a724d6dd95 100644 (file)
@@ -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;