vm/qubesvm: check if all required devices are available before start

Fail the VM start early if some persistently-assigned device is missing.
This will both save time and provide clearer error message.

Fixes QubesOS/qubes-issues#3810
This commit is contained in:
Marek Marczykowski-Górecki 2018-04-13 16:03:42 +02:00
parent 2aa14623bf
commit ba82d9dc21
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -865,6 +865,12 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
pre_event=True,
start_guid=start_guid, mem_required=mem_required)
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:
if self.virt_mode == 'pvh' and self.kernel is None: