summaryrefslogtreecommitdiff
path: root/nova/pci
diff options
context:
space:
mode:
authorVladik Romanovsky <vromanso@redhat.com>2015-11-23 23:43:07 -0500
committerNikola Dipanov <ndipanov@redhat.com>2016-01-11 11:18:13 +0000
commit50355c4595e08f293f610da32247e405b20c1c5b (patch)
treebd4210fb323df40337689df60d62f59a0d2704ed /nova/pci
parent5b13f1d0c533944115f4da4e85e6ddafc5d93037 (diff)
downloadnova-50355c4595e08f293f610da32247e405b20c1c5b.tar.gz
objects: adding a parent_addr field to the PciDevice object
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 <ndipanov@redhat.com> Partially implements blueprint sriov-physical-function-passthrough Change-Id: I94e8ce2c2a3d1c9e8b4aa1b245076eba84f37f45
Diffstat (limited to 'nova/pci')
-rw-r--r--nova/pci/devspec.py8
1 files changed, 2 insertions, 6 deletions
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