Don't allow attached PCI devices and virt_mode = 'pvh'
This commit is contained in:
parent
ec4c7d7263
commit
67c06eb428
@ -225,6 +225,10 @@ class PCIDeviceExtension(qubes.ext.Extension):
|
||||
raise qubes.exc.QubesException(
|
||||
'Invalid PCI device: {}'.format(device.ident))
|
||||
|
||||
if vm.virt_mode == 'pvh':
|
||||
raise qubes.exc.QubesException(
|
||||
"Can't attach PCI device to VM in pvh mode")
|
||||
|
||||
if not vm.is_running():
|
||||
return
|
||||
|
||||
|
@ -96,6 +96,9 @@ def _setter_virt_mode(self, prop, value):
|
||||
if value not in ('hvm', 'pv', 'pvh'):
|
||||
raise qubes.exc.QubesPropertyValueError(self, prop, value,
|
||||
'Invalid virtualization mode, supported values: hvm, pv, pvh')
|
||||
if value == 'pvh' and list(self.devices['pci'].persistent()):
|
||||
raise qubes.exc.QubesPropertyValueError(self, prop, value,
|
||||
"pvh mode can't be set if pci devices are attached")
|
||||
return value
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user