mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-22 13:34:07 +03:00
virtinst: take account of 'dies' when calc vcpu count from topology
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
95eb8dda9b
commit
7b68fe1a5e
@ -47,6 +47,12 @@ def test_misc_cpu_topology():
|
||||
cpu.topology.cores = 2
|
||||
assert cpu.vcpus_from_topology() == 10
|
||||
|
||||
cpu = virtinst.DomainCpu(conn)
|
||||
cpu.topology.sockets = 3
|
||||
cpu.topology.dies = 2
|
||||
cpu.topology.cores = 2
|
||||
assert cpu.vcpus_from_topology() == 12
|
||||
|
||||
cpu = virtinst.DomainCpu(conn)
|
||||
assert cpu.vcpus_from_topology() == 1
|
||||
|
||||
|
@ -365,6 +365,7 @@ class DomainCpu(XMLBuilder):
|
||||
no topology is set
|
||||
"""
|
||||
return ((self.topology.sockets or 1) *
|
||||
(self.topology.dies or 1) *
|
||||
(self.topology.cores or 1) *
|
||||
(self.topology.threads or 1))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user