From 116ba64e511039e657e67ba0261a1abd11dfeb66 Mon Sep 17 00:00:00 2001 From: Bahtiar `kalkin-` Gadimov Date: Thu, 5 May 2016 19:16:33 +0200 Subject: [PATCH] Storage.remove() catch IO/OSError and log it --- qubes/storage/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qubes/storage/__init__.py b/qubes/storage/__init__.py index ae914d29..3c7c2883 100644 --- a/qubes/storage/__init__.py +++ b/qubes/storage/__init__.py @@ -190,8 +190,15 @@ class Storage(object): 'VM directory does not exist: {}'.format(self.vm.dir_path)) def remove(self): + ''' Remove all the volumes. + + Errors on removal are catched and logged. + ''' for name, volume in self.vm.volumes.items(): - self.get_pool(volume).remove(volume) + try: + self.get_pool(volume).remove(volume) + except (IOError, OSError) as e: + self.vm.log.exception("Failed to remove volume %s", name, e) def start(self): ''' Execute the start method on each pool '''