Example of a PCI alias:
| pci_alias = '{
| "name": "QuicAssist",
| "product_id": "0443",
| "vendor_id": "8086",
| "device_type": "ACCEL",
| }'
Aliases with the same name and the same device_type are OR operation:
| pci_alias = '{
| "name": "QuicAssist",
| "product_id": "0442",
| "vendor_id": "8086",
| "device_type": "ACCEL",
| }'
These 2 aliases define a device request meaning: vendor_id is “8086” and product id is “0442” or “0443”.
Get flavor’s pci request.
The pci_passthrough:alias scope in flavor extra_specs describes the flavor’s pci requests, the key is ‘pci_passthrough:alias’ and the value has format ‘alias_name_x:count, alias_name_y:count, ... ‘. The alias_name is defined in ‘pci_alias’ configurations.
The flavor’s requirement is translated into pci requests list, each entry in the list is a dictionary. The dictionary has three keys. The ‘specs’ gives the pci device properties requirement, the ‘count’ gives the number of devices, and the optional ‘alias_name’ is the corresponding alias definition name.
Example: Assume alias configuration is:
| {'vendor_id':'8086',
| 'device_id':'1502',
| 'name':'alias_1'}
The flavor extra specs includes: ‘pci_passthrough:alias’: ‘alias_1:2’.
The returned pci_requests are:
| pci_requests = [{'count':2,
| 'specs': [{'vendor_id':'8086',
| 'device_id':'1502'}],
| 'alias_name': 'alias_1'}]
Parameters: | flavor – the flavor to be checked |
---|---|
Returns: | a list of pci requests |