diff --git a/qubes/ext/pci.py b/qubes/ext/pci.py index 1f6095c0..b5b8602d 100644 --- a/qubes/ext/pci.py +++ b/qubes/ext/pci.py @@ -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( diff --git a/templates/libvirt/devices/pci.xml b/templates/libvirt/devices/pci.xml index cc33c05c..8cfdc66c 100644 --- a/templates/libvirt/devices/pci.xml +++ b/templates/libvirt/devices/pci.xml @@ -1,5 +1,5 @@ diff --git a/templates/libvirt/xen.xml b/templates/libvirt/xen.xml index a494e2b0..2394e239 100644 --- a/templates/libvirt/xen.xml +++ b/templates/libvirt/xen.xml @@ -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 %}