qubes/mgmt: add missing events for permission for lifecycle
Thanks @marmarek for spotting this. QubesOS/qubes-issues#2622
This commit is contained in:
parent
c437f40284
commit
a520e8d768
@ -164,8 +164,11 @@ class QubesMgmt(AbstractQubesMgmt):
|
|||||||
assert not self.arg
|
assert not self.arg
|
||||||
assert self.dest.name == 'dom0'
|
assert self.dest.name == 'dom0'
|
||||||
|
|
||||||
|
entrypoints = self.fire_event_for_filter(
|
||||||
|
pkg_resources.iter_entry_points(qubes.vm.VM_ENTRY_POINT))
|
||||||
|
|
||||||
return ''.join('{}\n'.format(ep.name)
|
return ''.join('{}\n'.format(ep.name)
|
||||||
for ep in pkg_resources.iter_entry_points(qubes.vm.VM_ENTRY_POINT))
|
for ep in entrypoints)
|
||||||
|
|
||||||
@api('mgmt.vm.List', no_payload=True)
|
@api('mgmt.vm.List', no_payload=True)
|
||||||
async def vm_list(self):
|
async def vm_list(self):
|
||||||
@ -478,24 +481,29 @@ class QubesMgmt(AbstractQubesMgmt):
|
|||||||
@api('mgmt.vm.Start', no_payload=True)
|
@api('mgmt.vm.Start', no_payload=True)
|
||||||
async def vm_start(self):
|
async def vm_start(self):
|
||||||
assert not self.arg
|
assert not self.arg
|
||||||
|
self.fire_event_for_permission()
|
||||||
await self.dest.start()
|
await self.dest.start()
|
||||||
|
|
||||||
@api('mgmt.vm.Shutdown', no_payload=True)
|
@api('mgmt.vm.Shutdown', no_payload=True)
|
||||||
async def vm_shutdown(self):
|
async def vm_shutdown(self):
|
||||||
assert not self.arg
|
assert not self.arg
|
||||||
|
self.fire_event_for_permission()
|
||||||
await self.dest.shutdown()
|
await self.dest.shutdown()
|
||||||
|
|
||||||
@api('mgmt.vm.Pause', no_payload=True)
|
@api('mgmt.vm.Pause', no_payload=True)
|
||||||
async def vm_pause(self):
|
async def vm_pause(self):
|
||||||
assert not self.arg
|
assert not self.arg
|
||||||
|
self.fire_event_for_permission()
|
||||||
await self.dest.pause()
|
await self.dest.pause()
|
||||||
|
|
||||||
@api('mgmt.vm.Unpause', no_payload=True)
|
@api('mgmt.vm.Unpause', no_payload=True)
|
||||||
async def vm_unpause(self):
|
async def vm_unpause(self):
|
||||||
assert not self.arg
|
assert not self.arg
|
||||||
|
self.fire_event_for_permission()
|
||||||
await self.dest.unpause()
|
await self.dest.unpause()
|
||||||
|
|
||||||
@api('mgmt.vm.Kill', no_payload=True)
|
@api('mgmt.vm.Kill', no_payload=True)
|
||||||
async def vm_kill(self):
|
async def vm_kill(self):
|
||||||
assert not self.arg
|
assert not self.arg
|
||||||
|
self.fire_event_for_permission()
|
||||||
await self.dest.kill()
|
await self.dest.kill()
|
||||||
|
Loading…
Reference in New Issue
Block a user