vm/qubesvm: call storage.remove() *before* removing dir_path
Give the varlibqubes storage pool, which places volume images inside the VM directory, a chance to remove them (and e.g. to log that).
This commit is contained in:
parent
cfa1c7171e
commit
aa931fdbf7
@ -1622,12 +1622,14 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
yield from self._ensure_shutdown_handled()
|
yield from self._ensure_shutdown_handled()
|
||||||
|
|
||||||
yield from self.fire_event_async('domain-remove-from-disk')
|
yield from self.fire_event_async('domain-remove-from-disk')
|
||||||
|
try:
|
||||||
|
yield from self.storage.remove()
|
||||||
|
finally:
|
||||||
try:
|
try:
|
||||||
# TODO: make it async?
|
# TODO: make it async?
|
||||||
shutil.rmtree(self.dir_path)
|
shutil.rmtree(self.dir_path)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
pass
|
pass
|
||||||
yield from self.storage.remove()
|
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def clone_disk_files(self, src, pool=None, pools=None, ):
|
def clone_disk_files(self, src, pool=None, pools=None, ):
|
||||||
|
Loading…
Reference in New Issue
Block a user