Fix core2migration and tests for new devices API
QubesOS/qubes-issues#2257
This commit is contained in:
parent
e536bcca30
commit
11191ea694
@ -187,12 +187,12 @@ class Core2Qubes(qubes.Qubes):
|
||||
services = ast.literal_eval(services)
|
||||
else:
|
||||
services = {}
|
||||
for service, value in services.iteritems():
|
||||
for service, value in services.items():
|
||||
feature = service
|
||||
for repl_feature, repl_service in \
|
||||
qubes.ext.r3compatibility.\
|
||||
R3Compatibility.features_to_services.\
|
||||
iteritems():
|
||||
items():
|
||||
if repl_service == service:
|
||||
feature = repl_feature
|
||||
vm.features[feature] = value
|
||||
@ -205,7 +205,8 @@ class Core2Qubes(qubes.Qubes):
|
||||
pcidevs = ast.literal_eval(pcidevs)
|
||||
for pcidev in pcidevs:
|
||||
try:
|
||||
vm.devices["pci"].attach(pcidev)
|
||||
vm.devices["pci"].attach(
|
||||
self.domains[0].devices['pci'][pcidev])
|
||||
except qubes.exc.QubesException as e:
|
||||
self.log.error("VM {}: {}".format(vm.name, str(e)))
|
||||
except (ValueError, LookupError) as err:
|
||||
|
@ -67,7 +67,7 @@ class TC_00_Backup(qubes.tests.BackupTestsMixin, qubes.tests.QubesTestCase):
|
||||
self.assertEquals(orig_value, restored_value,
|
||||
"VM {} - property {} not properly restored".format(
|
||||
vm.name, prop))
|
||||
for dev_class in ["pci", "usb"]:
|
||||
for dev_class in vm.devices.keys():
|
||||
for dev in vm.devices[dev_class]:
|
||||
self.assertIn(dev, restored_vm.devices[dev_class])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user