[libvirt] [PATCH 3/7] storage:dir: .deleteVol callback for ploop volume

Olga Krishtal okrishtal at virtuozzo.com
Mon Mar 14 16:00:36 UTC 2016


Recursively deletes whole directory of a ploop volume.
To delete ploop image it has to be unmounted.

Signed-off-by: Olga Krishtal <okrishtal at virtuozzo.com>
---
 src/storage/storage_backend_fs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c
index 8517b26..77c94c9 100644
--- a/src/storage/storage_backend_fs.c
+++ b/src/storage/storage_backend_fs.c
@@ -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:
-- 
1.8.3.1




More information about the libvir-list mailing list