diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c index 9a91dd9a74475e2b0d757e8e81f3d632f525f580..302c3dd7cb78be936af579af89def01d6ed834a3 100644 --- a/src/storage/storage_backend_logical.c +++ b/src/storage/storage_backend_logical.c @@ -679,6 +679,7 @@ virStorageBackendLogicalCreateVol(virConnectPtr conn, "-s", vol->backingStore.path, NULL }; const char **cmdargv = cmdargvnew; + virErrorPtr err; if (vol->target.encryption != NULL) { virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -750,8 +751,10 @@ virStorageBackendLogicalCreateVol(virConnectPtr conn, return 0; cleanup: + err = virSaveLastError(); VIR_FORCE_CLOSE(fd); virStorageBackendLogicalDeleteVol(conn, pool, vol, 0); + virSetError(err); return -1; }