diff --git a/qubes/core2migration.py b/qubes/core2migration.py index fc2d669e..70c45e6f 100644 --- a/qubes/core2migration.py +++ b/qubes/core2migration.py @@ -24,6 +24,7 @@ import xml.parsers.expat import lxml.etree import qubes +import qubes.devices import qubes.vm.appvm import qubes.vm.standalonevm import qubes.vm.templatevm @@ -219,8 +220,9 @@ class Core2Qubes(qubes.Qubes): pcidevs = ast.literal_eval(pcidevs) for pcidev in pcidevs: try: - vm.devices["pci"].attach( - self.domains[0].devices['pci'][pcidev]) + dev = self.domains[0].devices['pci'][pcidev] + assignment = qubes.devices.DeviceAssignment(backend_domain=dev.backend_domain, ident=dev.ident) + vm.devices["pci"].attach(assignment) except qubes.exc.QubesException as e: self.log.error("VM {}: {}".format(vm.name, str(e))) except (ValueError, LookupError) as err: diff --git a/qubes/tests/vm/init.py b/qubes/tests/vm/init.py index 072271ae..d5439a4c 100644 --- a/qubes/tests/vm/init.py +++ b/qubes/tests/vm/init.py @@ -108,7 +108,7 @@ class TC_10_BaseVM(qubes.tests.QubesTestCase): }) self.assertCountEqual(vm.devices.keys(), ('pci',)) - self.assertCountEqual(list(vm.devices['pci'].attached(persistent=True)), + self.assertCountEqual(list(vm.devices['pci'].persistent()), [qubes.ext.pci.PCIDevice(vm, '00:11.22')]) self.assertXMLIsValid(vm.__xml__(), 'domain.rng')