qubesvm: move storage.stop() to 'domain-shutdown' event handler
QubesOS/qubes-issues#2256
This commit is contained in:
parent
0dfcaa63c9
commit
838553baf8
@ -901,6 +901,11 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
@qubes.events.handler('domain-shutdown')
|
||||||
|
def on_domain_shutdown(self, _event, **_kwargs):
|
||||||
|
'''Cleanup after domain shutdown'''
|
||||||
|
asyncio.ensure_future(self.storage.stop())
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def shutdown(self, force=False, wait=False):
|
def shutdown(self, force=False, wait=False):
|
||||||
'''Shutdown domain.
|
'''Shutdown domain.
|
||||||
@ -916,9 +921,6 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
|
|
||||||
self.libvirt_domain.shutdown()
|
self.libvirt_domain.shutdown()
|
||||||
|
|
||||||
# FIXME: move to libvirt domain destroy event handler
|
|
||||||
yield from self.storage.stop()
|
|
||||||
|
|
||||||
while wait and not self.is_halted():
|
while wait and not self.is_halted():
|
||||||
yield from asyncio.sleep(0.25)
|
yield from asyncio.sleep(0.25)
|
||||||
|
|
||||||
@ -936,8 +938,6 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
raise qubes.exc.QubesVMNotStartedError(self)
|
raise qubes.exc.QubesVMNotStartedError(self)
|
||||||
|
|
||||||
self.libvirt_domain.destroy()
|
self.libvirt_domain.destroy()
|
||||||
# FIXME: move to libvirt domain destroy event handler
|
|
||||||
yield from self.storage.stop()
|
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user