]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: dir: .deleteVol callback for ploop volume
authorOlga Krishtal <okrishtal@virtuozzo.com>
Mon, 11 Apr 2016 16:16:21 +0000 (19:16 +0300)
committerJán Tomko <jtomko@redhat.com>
Fri, 15 Apr 2016 15:27:32 +0000 (17:27 +0200)
Recursively deletes whole directory of a ploop volume.
To delete ploop image it has to be unmounted.

Signed-off-by: Olga Krishtal <okrishtal@virtuozzo.com>
src/storage/storage_backend_fs.c

index 8517b26bf80c73d7eb6519b8e62317ce518794f6..ebfe7453e126b50303a6166d4823ab227f531d1e 100644 (file)
@@ -1264,6 +1264,9 @@ virStorageBackendFileSystemVolDelete(virConnectPtr conn ATTRIBUTE_UNUSED,
         }
         break;
     case VIR_STORAGE_VOL_PLOOP:
+        if (virFileDeleteTree(vol->target.path) < 0)
+            return -1;
+        break;
     case VIR_STORAGE_VOL_BLOCK:
     case VIR_STORAGE_VOL_NETWORK:
     case VIR_STORAGE_VOL_NETDIR: