From 50355c4595e08f293f610da32247e405b20c1c5b Mon Sep 17 00:00:00 2001 From: Vladik Romanovsky Date: Mon, 23 Nov 2015 23:43:07 -0500 Subject: objects: adding a parent_addr field to the PciDevice object MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The parent_addr field will help identify the relationship between Physical and Virtual pci device functions. This information was already available to the PciDevice objects and was stored in extra_info['phys_function'] field, so we add code that will migrate old data on the fly, for live upgrade scenarios where we still have running older compute nodes alongside new ones. We don't want to migrate, however, if there are still any API service instances running that might access this info directly (without the help of the conductor) but have not been upgraded yet. Co-authored-by: Nikola Đipanov Partially implements blueprint sriov-physical-function-passthrough Change-Id: I94e8ce2c2a3d1c9e8b4aa1b245076eba84f37f45 --- nova/pci/devspec.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'nova/pci') diff --git a/nova/pci/devspec.py b/nova/pci/devspec.py index ea55f21299..e2189d83b6 100644 --- a/nova/pci/devspec.py +++ b/nova/pci/devspec.py @@ -161,19 +161,15 @@ class PciDeviceSpec(object): self.vendor_id in (ANY, dev_dict['vendor_id']), self.product_id in (ANY, dev_dict['product_id']), self.address.match(dev_dict['address'], - dev_dict.get('phys_function')) + dev_dict.get('parent_addr')) ] return all(conditions) def match_pci_obj(self, pci_obj): - if pci_obj.extra_info: - phy_func = pci_obj.extra_info.get('phys_function') - else: - phy_func = None return self.match({'vendor_id': pci_obj.vendor_id, 'product_id': pci_obj.product_id, 'address': pci_obj.address, - 'phys_function': phy_func}) + 'parent_addr': pci_obj.parent_addr}) def get_tags(self): return self.tags -- cgit v1.2.1