vm: send domain-start-failed event also if some device is missing

Checking device presence wasn't covered with try/except that send the
event.
This commit is contained in:
Marek Marczykowski-Górecki 2018-11-15 10:13:45 +01:00
parent 0eab082d85
commit 35a53840f1
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -962,14 +962,15 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
reason=str(exc))
raise
for devclass in self.devices:
for dev in self.devices[devclass].persistent():
if isinstance(dev, qubes.devices.UnknownDevice):
raise qubes.exc.QubesException(
'{} device {} not available'.format(devclass, dev))
qmemman_client = None
try:
for devclass in self.devices:
for dev in self.devices[devclass].persistent():
if isinstance(dev, qubes.devices.UnknownDevice):
raise qubes.exc.QubesException(
'{} device {} not available'.format(
devclass, dev))
if self.virt_mode == 'pvh' and not self.kernel:
raise qubes.exc.QubesException(
'virt_mode PVH require kernel to be set')