Skip to content

Commit

Permalink
Add missing condition
Browse files Browse the repository at this point in the history
Change [1] added new fields 'src|dst_supports_numa_live_migration'
to LibvirtLiveMigrateData object, but missed if condition for
dst_supports_numa_live_migration field in obj_make_compatible
method.

This change adds the if condition as well as fix typo in unit test
because of which this wasn't catched earlier.

Closes-Bug: #1975891
Change-Id: Ice5a2c7aca77f47ea6328a10d835854d9aff408e
(cherry picked from commit 3aa77a3)
(cherry picked from commit dfa05d6)
  • Loading branch information
ratailor authored and Elod Illes committed Jun 18, 2022
1 parent 90c5190 commit 7c40596
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions nova/objects/migrate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ def obj_make_compatible(self, primitive, target_version):
if (target_version < (1, 10) and
'src_supports_numa_live_migration' in primitive):
del primitive['src_supports_numa_live_migration']
if (target_version < (1, 10) and
'dst_supports_numa_live_migration' in primitive):
del primitive['dst_supports_numa_live_migration']
if target_version < (1, 10) and 'dst_numa_info' in primitive:
del primitive['dst_numa_info']
if target_version < (1, 9) and 'vifs' in primitive:
Expand Down
4 changes: 2 additions & 2 deletions nova/tests/unit/objects/test_migrate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def test_obj_make_compatible(self):
target_connect_addr='127.0.0.1',
dst_wants_file_backed_memory=False,
file_backed_memory_discard=False,
src_supports_numa_live_migraton=True,
dst_supports_numa_live_migraton=True,
src_supports_numa_live_migration=True,
dst_supports_numa_live_migration=True,
dst_numa_info=migrate_data.LibvirtLiveMigrateNUMAInfo())
manifest = ovo_base.obj_tree_get_versions(obj.obj_name())

Expand Down

0 comments on commit 7c40596

Please sign in to comment.