admin.vm.Start: report libvirt errors to caller
Convert them to QubesException for that.
This commit is contained in:
parent
207d497bfe
commit
d57aef96e5
@ -24,9 +24,9 @@ Qubes OS Management API
|
|||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import string
|
import string
|
||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
import libvirt
|
||||||
|
|
||||||
import qubes.api
|
import qubes.api
|
||||||
import qubes.devices
|
import qubes.devices
|
||||||
@ -486,7 +486,12 @@ class QubesAdminAPI(qubes.api.AbstractQubesAPI):
|
|||||||
def vm_start(self):
|
def vm_start(self):
|
||||||
assert not self.arg
|
assert not self.arg
|
||||||
self.fire_event_for_permission()
|
self.fire_event_for_permission()
|
||||||
yield from self.dest.start()
|
try:
|
||||||
|
yield from self.dest.start()
|
||||||
|
except libvirt.libvirtError as e:
|
||||||
|
# change to QubesException, so will be reported to the user
|
||||||
|
raise qubes.exc.QubesException('Start failed: ' + str(e))
|
||||||
|
|
||||||
|
|
||||||
@qubes.api.method('admin.vm.Shutdown', no_payload=True)
|
@qubes.api.method('admin.vm.Shutdown', no_payload=True)
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
|
Loading…
Reference in New Issue
Block a user