From d1a0542c851535c5c26f8be3fe0c6ecad64b67ed Mon Sep 17 00:00:00 2001 From: Bahtiar `kalkin-` Gadimov Date: Fri, 15 Apr 2016 17:10:55 +0200 Subject: [PATCH] Add XenPool.remove() --- qubes/storage/xen.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qubes/storage/xen.py b/qubes/storage/xen.py index c1b0f803..aad54d9b 100644 --- a/qubes/storage/xen.py +++ b/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(