Exemplo n.º 1
0
 def test_spec_extra_key(self):
     self.assertFalse(
         utils.pci_device_prop_match(self.fake_pci_1, [{
             'vendor_id': 'v1',
             'device_id': 'd1',
             'wrong_key': 'k1'
         }]))
Exemplo n.º 2
0
 def test_spec_dismatch(self):
     self.assertFalse(
         utils.pci_device_prop_match(self.fake_pci_1, [{
             'vendor_id': 'v4',
             'device_id': 'd4'
         }, {
             'vendor_id': 'v3',
             'device_id': 'd3'
         }]))
Exemplo n.º 3
0
 def test_multiple_spec_match(self):
     self.assertTrue(
         utils.pci_device_prop_match(self.fake_pci_1, [{
             'vendor_id': 'v1',
             'device_id': 'd1'
         }, {
             'vendor_id': 'v3',
             'device_id': 'd3'
         }]))
Exemplo n.º 4
0
 def _filter_pools_for_numa_cells(pools, numa_cells):
     # Some systems don't report numa node info for pci devices, in
     # that case None is reported in pci_device.numa_node, by adding None
     # to numa_cells we allow assigning those devices to instances with
     # numa topology
     numa_cells = [None] + [cell.id for cell in numa_cells]
     # filter out pools which numa_node is not included in numa_cells
     return [pool for pool in pools if any(utils.pci_device_prop_match(
                             pool, [{'numa_node': cell}])
                                           for cell in numa_cells)]
Exemplo n.º 5
0
 def _filter_pools_for_numa_cells(pools, numa_cells):
     # Some systems don't report numa node info for pci devices, in
     # that case None is reported in pci_device.numa_node, by adding None
     # to numa_cells we allow assigning those devices to instances with
     # numa topology
     numa_cells = [None] + [cell.id for cell in numa_cells]
     # filter out pools which numa_node is not included in numa_cells
     return [
         pool for pool in pools if any(
             utils.pci_device_prop_match(pool, [{
                 'numa_node': cell
             }]) for cell in numa_cells)
     ]
Exemplo n.º 6
0
 def _filter_pools_for_spec(pools, request_specs):
     return [pool for pool in pools
             if utils.pci_device_prop_match(pool, request_specs)]
Exemplo n.º 7
0
 def _filter_pools_for_spec(pools, request_specs):
     return [
         pool for pool in pools
         if utils.pci_device_prop_match(pool, request_specs)
     ]