Merge "Revert "Store correct VirtCPUTopology""

This commit is contained in:
Jenkins 2015-11-12 15:39:02 +00:00 committed by Gerrit Code Review
commit 2a84b49879
3 changed files with 0 additions and 32 deletions

View File

@ -4472,33 +4472,6 @@ class LibvirtConnTestCase(test.NoDBTestCase):
self.assertEqual(conf.cpu.cores, 1)
self.assertEqual(conf.cpu.threads, 1)
@mock.patch.object(host.Host, "has_min_version", return_value=True)
def test_get_guest_cpu_config_numa_topology(self, mock_has_min_version):
drvr = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)
instance_ref = objects.Instance(**self.test_instance)
instance_ref.flavor.vcpus = 2
instance_ref.numa_topology = objects.InstanceNUMATopology(cells=[
objects.InstanceNUMACell(
id=0,
cpuset=set([0, 1]),
memory=1024,
cpu_pinning={})])
image_meta = objects.ImageMeta.from_dict(self.test_image_meta)
disk_info = blockinfo.get_disk_info(CONF.libvirt.virt_type,
instance_ref,
image_meta)
self.assertIsNone(instance_ref.numa_topology.cells[0].cpu_topology)
drvr._get_guest_config(instance_ref,
_fake_network_info(self.stubs, 1),
image_meta, disk_info)
topo = instance_ref.numa_topology.cells[0].cpu_topology
self.assertIsNotNone(topo)
self.assertEqual(topo.cores * topo.sockets * topo.threads,
instance_ref.flavor.vcpus)
def test_get_guest_cpu_topology(self):
instance_ref = objects.Instance(**self.test_instance)
instance_ref.flavor.vcpus = 8

View File

@ -708,7 +708,6 @@ def _pack_instance_onto_cores(available_siblings, instance_cell, host_cell_id):
pinning = zip(sorted(instance_cell.cpuset),
itertools.chain(*sliced_sibs))
# NOTE(sfinucan) - this may be overriden later on by the drivers
topology = (instance_cell.cpu_topology or
objects.VirtCPUTopology(sockets=1,
cores=len(sliced_sibs),

View File

@ -3261,10 +3261,6 @@ class LibvirtDriver(driver.ComputeDriver):
topology = hardware.get_best_cpu_topology(
flavor, image_meta, numa_topology=instance_numa_topology)
if instance_numa_topology:
for cell in instance_numa_topology.cells:
cell.cpu_topology = topology
cpu.sockets = topology.sockets
cpu.cores = topology.cores
cpu.threads = topology.threads