From a55ea8c92914d78ad63aca393dc4c70539c227a9 Mon Sep 17 00:00:00 2001 From: Nikola Dipanov Date: Tue, 14 Jul 2015 16:25:15 +0100 Subject: [PATCH] Fix the incorrect PciDeviceList version number The following commit missed to bump the related list when bumping the object version. commit 1d4ad44f15503b8710ff59dea9f5e3f4894d56fb Author: Przemyslaw Czesnowicz Date: Thu Nov 20 12:04:05 2014 +0000 Add numa_node to PCIDevice The change extends the PCI device model and its DB representation. Query libvirt for the PCI devices numa node. This patch adds the necessary changes to master. We only bump the PciDeviceList version, and add a backporting rule to obj_relationship dictionary of the Instance object, to start sending the new version with 1.18 version of the instance (we are currently on 1.21) The master patch fixes versioning going forward, and all interactions that request the PciDeviceList through the Instance object, however applying this stable/kilo backport is required for Kilo nodes to start requesting the latest version of PciDevice through PciDeviceList. (cherry picked from commit 80c109f85a9e8b182e918027731760e91026cb81) Conflicts: nova/objects/instance.py nova/tests/unit/objects/test_objects.py Closes-bug: #1474074 Change-Id: Id743848061d2bcd64d785979c7a11ee7c945f06b --- nova/objects/instance.py | 5 +++-- nova/objects/pci_device.py | 3 ++- nova/tests/unit/objects/test_objects.py | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/nova/objects/instance.py b/nova/objects/instance.py index da61e9e06c10..8e9ff843ab99 100644 --- a/nova/objects/instance.py +++ b/nova/objects/instance.py @@ -151,7 +151,8 @@ class Instance(base.NovaPersistentObject, base.NovaObject, # Version 1.15: PciDeviceList 1.1 # Version 1.16: Added pci_requests # Version 1.17: Added tags - # Version 1.18: Added flavor, old_flavor, new_flavor + # Version 1.18: Added flavor, old_flavor, new_flavor, will use + # PciDeviceList version 1.2 # Version 1.19: Added vcpu_model VERSION = '1.19' @@ -256,7 +257,7 @@ class Instance(base.NovaPersistentObject, base.NovaObject, 'fault': [('1.0', '1.0')], 'info_cache': [('1.1', '1.0'), ('1.9', '1.4'), ('1.10', '1.5')], 'security_groups': [('1.2', '1.0')], - 'pci_devices': [('1.6', '1.0'), ('1.15', '1.1')], + 'pci_devices': [('1.6', '1.0'), ('1.15', '1.1'), ('1.18', '1.2')], 'numa_topology': [('1.14', '1.0')], 'pci_requests': [('1.16', '1.1')], 'tags': [('1.17', '1.0')], diff --git a/nova/objects/pci_device.py b/nova/objects/pci_device.py index 96ff27b602f2..e636eced0232 100644 --- a/nova/objects/pci_device.py +++ b/nova/objects/pci_device.py @@ -183,7 +183,8 @@ class PciDeviceList(base.ObjectListBase, base.NovaObject): # Version 1.0: Initial version # PciDevice <= 1.1 # Version 1.1: PciDevice 1.2 - VERSION = '1.1' + # Version 1.2: PciDevice 1.3 + VERSION = '1.2' fields = { 'objects': fields.ListOfObjectsField('PciDevice'), diff --git a/nova/tests/unit/objects/test_objects.py b/nova/tests/unit/objects/test_objects.py index f4a378e45fbe..236b5cae7280 100644 --- a/nova/tests/unit/objects/test_objects.py +++ b/nova/tests/unit/objects/test_objects.py @@ -1251,7 +1251,7 @@ object_data = { 'NetworkRequest': '1.1-f31192f5a725017707f989585e12d7dc', 'NetworkRequestList': '1.1-beeab521ac9450f1f5ef4eaa945a783c', 'PciDevice': '1.3-6d37f795ee934e7db75b5a6a1926def0', - 'PciDeviceList': '1.1-38cbe2d3c23b9e46f7a74b486abcad85', + 'PciDeviceList': '1.2-38cbe2d3c23b9e46f7a74b486abcad85', 'PciDevicePool': '1.1-2f352e08e128ec5bc84bc3007936cc6d', 'PciDevicePoolList': '1.1-beeab521ac9450f1f5ef4eaa945a783c', 'Quotas': '1.2-615ed622082c92d938119fd49e6d84ee', @@ -1284,7 +1284,7 @@ object_relationships = { 'Instance': {'InstanceFault': '1.2', 'InstanceInfoCache': '1.5', 'InstanceNUMATopology': '1.1', - 'PciDeviceList': '1.1', + 'PciDeviceList': '1.2', 'TagList': '1.0', 'SecurityGroupList': '1.0', 'Flavor': '1.1',