Merge "Generated passthrough_whitelist shall use all the user_configs fields"
This commit is contained in:
commit
a682f4b25c
@ -122,7 +122,7 @@ def get_pci_passthrough_whitelist(user_config, pf, pci_addresses,
|
|||||||
pci_passthrough_list = []
|
pci_passthrough_list = []
|
||||||
|
|
||||||
for pci in pci_addresses:
|
for pci in pci_addresses:
|
||||||
pci_passthrough = {}
|
pci_passthrough = dict(user_config)
|
||||||
address = {}
|
address = {}
|
||||||
pci_params = re.split('[:.]+', pci)
|
pci_params = re.split('[:.]+', pci)
|
||||||
address['domain'] = '.*'
|
address['domain'] = '.*'
|
||||||
@ -130,10 +130,11 @@ def get_pci_passthrough_whitelist(user_config, pf, pci_addresses,
|
|||||||
address['slot'] = pci_params[2]
|
address['slot'] = pci_params[2]
|
||||||
address['function'] = pci_params[3]
|
address['function'] = pci_params[3]
|
||||||
pci_passthrough['address'] = address
|
pci_passthrough['address'] = address
|
||||||
pci_passthrough['vendor_id'] = device_info[pf][0]
|
|
||||||
pci_passthrough['product_id'] = device_info[pf][1]
|
# devname and address fields can't co exist
|
||||||
if 'trusted' in user_config:
|
if 'devname' in pci_passthrough:
|
||||||
pci_passthrough['trusted'] = user_config['trusted']
|
del pci_passthrough['devname']
|
||||||
|
|
||||||
pci_passthrough_list.append(pci_passthrough)
|
pci_passthrough_list.append(pci_passthrough)
|
||||||
return pci_passthrough_list
|
return pci_passthrough_list
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user