From: John Ferlan Date: Thu, 17 Dec 2015 12:30:03 +0000 (-0500) Subject: storage: Attempt to refresh volume after successful wipe volume X-Git-Tag: v1.3.1-rc1~166 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80ca86e54d101508ba6f3c5affc420d946810331;p=thirdparty%2Flibvirt.git storage: Attempt to refresh volume after successful wipe volume https://bugzilla.redhat.com/show_bug.cgi?id=1270709 When a volume wipe is successful, perform a volume refresh afterwards to update any volume data that may be used in future volume commands, such as volume resize. For a raw file volume, a wipe could truncate the file and a followup volume resize the capacity may fail because the volume target allocation isn't updated to reflect the wipe activity. --- diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index bbf21f684f..2531a8817f 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -2436,7 +2436,14 @@ storageVolWipePattern(virStorageVolPtr obj, goto cleanup; } - ret = backend->wipeVol(obj->conn, pool, vol, algorithm, flags); + if (backend->wipeVol(obj->conn, pool, vol, algorithm, flags) < 0) + goto cleanup; + + if (backend->refreshVol && + backend->refreshVol(obj->conn, pool, vol) < 0) + goto cleanup; + + ret = 0; cleanup: virStoragePoolObjUnlock(pool);