Browse Source

Add XenPool.remove()

Bahtiar `kalkin-` Gadimov 8 years ago
parent
commit
d1a0542c85
1 changed files with 7 additions and 0 deletions
  1. 7 0
      qubes/storage/xen.py

+ 7 - 0
qubes/storage/xen.py

@@ -113,6 +113,13 @@ class XenPool(Pool):
 
         self._resize_loop_device(path)
 
+    def remove(self, volume):
+        if volume.volume_type in ['read-write', 'volatile']:
+            _remove_if_exists(volume.vid)
+        elif volume.volume_type == 'origin':
+            _remove_if_exists(volume.vid)
+            _remove_if_exists(volume.path_cow)
+
     def _resize_loop_device(self, path):
         # find loop device if any
         p = subprocess.Popen(