Merge "fix up numa-topology live migration hypervisor check" into stable/queens

This commit is contained in:
Zuul 2019-07-04 00:16:15 +00:00 committed by Gerrit Code Review
commit de7a8f9e44
2 changed files with 5 additions and 2 deletions

View File

@ -152,7 +152,10 @@ class LiveMigrationTask(base.TaskBase):
# HyperV's vNUMA feature doesn't allow specific pinning # HyperV's vNUMA feature doesn't allow specific pinning
hypervisor_type = objects.ComputeNode.get_by_host_and_nodename( hypervisor_type = objects.ComputeNode.get_by_host_and_nodename(
self.context, self.source, self.instance.node).hypervisor_type self.context, self.source, self.instance.node).hypervisor_type
if hypervisor_type != obj_fields.HVType.KVM:
# KVM is not a hypervisor, so when using a virt_type of "kvm" the
# hypervisor_type will still be "QEMU".
if hypervisor_type.lower() != obj_fields.HVType.QEMU:
return return
msg = ('Instance has an associated NUMA topology. ' msg = ('Instance has an associated NUMA topology. '

View File

@ -210,7 +210,7 @@ class LiveMigrationTaskTestCase(test.NoDBTestCase):
def test_check_instance_has_no_numa_fails(self, mock_get): def test_check_instance_has_no_numa_fails(self, mock_get):
self.flags(enable_numa_live_migration=False, group='workarounds') self.flags(enable_numa_live_migration=False, group='workarounds')
mock_get.return_value = objects.ComputeNode( mock_get.return_value = objects.ComputeNode(
uuid=uuids.cn1, hypervisor_type='kvm') uuid=uuids.cn1, hypervisor_type='QEMU')
self.task.instance.numa_topology = objects.InstanceNUMATopology( self.task.instance.numa_topology = objects.InstanceNUMATopology(
cells=[objects.InstanceNUMACell(id=0, cpuset=set([0]), cells=[objects.InstanceNUMACell(id=0, cpuset=set([0]),
memory=1024)]) memory=1024)])