diff --git a/qubes/ext/block.py b/qubes/ext/block.py index 6424a862e..243fc5dc5 100644 --- a/qubes/ext/block.py +++ b/qubes/ext/block.py @@ -548,7 +548,6 @@ async def on_domain_start(self, vm, _event, **_kwargs): if assignment.required: # already attached continue - # TODO: notify? for device in assignment.devices: if isinstance(device, qubes.device_protocol.UnknownDevice): continue diff --git a/qubes/ext/pci.py b/qubes/ext/pci.py index fae3090d9..eaaffe2a8 100644 --- a/qubes/ext/pci.py +++ b/qubes/ext/pci.py @@ -393,7 +393,6 @@ def on_device_pre_attached_pci(self, vm, event, device, options): return try: - # TODO? device = _cache_get(device.backend_domain, device.port_id) self.bind_pci_to_pciback(vm.app, device) vm.libvirt_domain.attachDevice( @@ -446,7 +445,6 @@ def on_device_pre_detached_pci(self, vm, event, port): def on_domain_pre_start(self, vm, _event, **_kwargs): # Bind pci devices to pciback driver for assignment in vm.devices['pci'].get_assigned_devices(): - # TODO? device = _cache_get(assignment.backend_domain, assignment.port_id) self.bind_pci_to_pciback(vm.app, device) diff --git a/qubes/tests/integ/devices_pci.py b/qubes/tests/integ/devices_pci.py index 03f75af78..459123d5d 100644 --- a/qubes/tests/integ/devices_pci.py +++ b/qubes/tests/integ/devices_pci.py @@ -39,10 +39,7 @@ def setUp(self): pcidev = os.environ['QUBES_TEST_PCIDEV'] self.dev = self.app.domains[0].devices['pci'][pcidev] self.assignment = DeviceAssignment( - self.dev, mode='auto-attach' - ) - self.required_assignment = DeviceAssignment( - self.dev, mode='required', + self.dev, mode='required' ) if isinstance(self.dev, qubes.device_protocol.UnknownDevice): self.skipTest('Specified device {} does not exists'.format(pcidev)) @@ -91,7 +88,7 @@ def assertDeviceIs( dedicated = assigned or attached self.assertTrue(dedicated == device in dev_col.get_dedicated_devices()) - def test_010_assign_offline(self): # TODO required + def test_010_assign_offline(self): dev_col = self.vm.devices['pci'] self.assertDeviceIs( self.dev, attached=False, assigned=False, required=False) @@ -99,11 +96,11 @@ def test_010_assign_offline(self): # TODO required self.loop.run_until_complete(dev_col.assign(self.assignment)) self.app.save() self.assertDeviceIs( - self.dev, attached=False, assigned=True, required=False) + self.dev, attached=False, assigned=True, required=True) self.loop.run_until_complete(self.vm.start()) self.assertDeviceIs( - self.dev, attached=True, assigned=False, required=False) + self.dev, attached=True, assigned=False, required=True) (stdout, _) = self.loop.run_until_complete( self.vm.run_for_stdio('lspci')) @@ -119,7 +116,7 @@ def test_011_attach_offline_temp_fail(self): self.loop.run_until_complete( dev_col.attach(self.assignment)) - def test_020_attach_online_persistent(self): # TODO: required + def test_020_attach_online_persistent(self): self.loop.run_until_complete( self.vm.start()) dev_col = self.vm.devices['pci'] @@ -129,7 +126,7 @@ def test_020_attach_online_persistent(self): # TODO: required self.loop.run_until_complete( dev_col.attach(self.assignment)) self.assertDeviceIs( - self.dev, attached=True, assigned=True, required=False) + self.dev, attached=True, assigned=True, required=True) # give VM kernel some time to discover new device time.sleep(1) @@ -151,7 +148,7 @@ def test_021_persist_detach_online_fail(self): self.loop.run_until_complete( self.vm.devices['pci'].detach(self.assignment)) - def test_030_persist_attach_detach_offline(self): # TODO: required + def test_030_persist_attach_detach_offline(self): dev_col = self.vm.devices['pci'] self.assertDeviceIs( self.dev, attached=False, assigned=False, required=False) @@ -160,14 +157,14 @@ def test_030_persist_attach_detach_offline(self): # TODO: required dev_col.attach(self.assignment)) self.app.save() self.assertDeviceIs( - self.dev, attached=False, assigned=True, required=False) + self.dev, attached=False, assigned=True, required=True) self.loop.run_until_complete( dev_col.detach(self.assignment)) self.assertDeviceIs( self.dev, attached=False, assigned=False, required=False) - def test_031_attach_detach_online_temp(self): # TODO: requiured + def test_031_attach_detach_online_temp(self): dev_col = self.vm.devices['pci'] self.loop.run_until_complete( self.vm.start())