From 3d6de04e3a1c9891cd9d3150775d52f5d05156fe Mon Sep 17 00:00:00 2001 From: Karthik S Date: Tue, 21 Jul 2020 14:01:50 +0000 Subject: [PATCH] Generated passthrough_whitelist shall use all the user_configs fields Earlier, the derived pci passthrough whitelist includes the address, vendor and product details only. This is not sufficient for nova to allocate the VFs to the guests. Now, all the fields of the user_config shall be used in the derived passthrough_whitelist. Only either of 'address' or 'devname' shall be provided in passthrough_whitelist, and since the 'address' fields are must have to specify the induvidual VF's, the 'devname' is removed if present. Change-Id: I5a337a67893241e1443ca2c3721f4c9dd78b95c8 (cherry picked from commit d5820dba4abc9fc531b4155cb9f95038f956710c) --- .../neutron/derive_pci_passthrough_whitelist.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/deployment/neutron/derive_pci_passthrough_whitelist.py b/deployment/neutron/derive_pci_passthrough_whitelist.py index 4c0ca157ed..92989abdf6 100644 --- a/deployment/neutron/derive_pci_passthrough_whitelist.py +++ b/deployment/neutron/derive_pci_passthrough_whitelist.py @@ -122,7 +122,7 @@ def get_pci_passthrough_whitelist(user_config, pf, pci_addresses, pci_passthrough_list = [] for pci in pci_addresses: - pci_passthrough = {} + pci_passthrough = dict(user_config) address = {} pci_params = re.split('[:.]+', pci) address['domain'] = '.*' @@ -130,10 +130,11 @@ def get_pci_passthrough_whitelist(user_config, pf, pci_addresses, address['slot'] = pci_params[2] address['function'] = pci_params[3] pci_passthrough['address'] = address - pci_passthrough['vendor_id'] = device_info[pf][0] - pci_passthrough['product_id'] = device_info[pf][1] - if 'trusted' in user_config: - pci_passthrough['trusted'] = user_config['trusted'] + + # devname and address fields can't co exist + if 'devname' in pci_passthrough: + del pci_passthrough['devname'] + pci_passthrough_list.append(pci_passthrough) return pci_passthrough_list