pci: use device attach options for disabling strict reset

Since we have now per-device options, it's more logical to use it here,
instead of features with device identifier encoded into feature name.
This commit is contained in:
Marek Marczykowski-Górecki 2017-05-22 01:01:45 +02:00
parent d0b8933374
commit 402afa1925
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
3 changed files with 5 additions and 3 deletions

View File

@ -233,7 +233,7 @@ class PCIDeviceExtension(qubes.ext.Extension):
self.bind_pci_to_pciback(vm.app, device)
vm.libvirt_domain.attachDevice(
vm.app.env.get_template('libvirt/devices/pci.xml').render(
device=device, vm=vm))
device=device, vm=vm, options=options))
except subprocess.CalledProcessError as e:
vm.log.exception('Failed to attach PCI device {!r} on the fly,'
' changes will be seen after VM restart.'.format(

View File

@ -1,5 +1,5 @@
<hostdev type="pci" managed="yes"
{% if vm.features.get('pci-no-strict-reset/' + device.ident, False) %}
{% if options.get('no-strict-reset', False) %}
nostrictreset="yes"
{% endif %}
>

View File

@ -106,7 +106,9 @@
{% include 'libvirt/devices/net.xml' with context %}
{% endif %}
{% for device in vm.devices.pci.persistent() %}
{% for assignment in vm.devices.pci.assignments(True) %}
{% set device = assignment.device %}
{% set options = assignment.options %}
{% include 'libvirt/devices/pci.xml' %}
{% endfor %}