mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-21 18:03:58 +03:00
virtinst: set dies in topology to 1
It is always permitted to set dies==1 regardless of architecture or machine type. The only constraint is around setting values > 1, for archs/machines that don't support the dies concept. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
7b68fe1a5e
commit
c1491ae142
@ -25,7 +25,7 @@
|
||||
<vmport state="off"/>
|
||||
</features>
|
||||
<cpu>
|
||||
<topology sockets="4" cores="1" threads="1"/>
|
||||
<topology sockets="4" dies="1" cores="1" threads="1"/>
|
||||
</cpu>
|
||||
<clock offset="utc">
|
||||
<timer name="rtc" tickpolicy="catchup"/>
|
||||
|
@ -23,7 +23,7 @@
|
||||
</hyperv>
|
||||
</features>
|
||||
<cpu>
|
||||
<topology sockets="1" cores="4" threads="1"/>
|
||||
<topology sockets="1" dies="1" cores="4" threads="1"/>
|
||||
</cpu>
|
||||
<clock offset="localtime"/>
|
||||
<on_reboot>destroy</on_reboot>
|
||||
@ -74,7 +74,7 @@
|
||||
</hyperv>
|
||||
</features>
|
||||
<cpu>
|
||||
<topology sockets="1" cores="4" threads="1"/>
|
||||
<topology sockets="1" dies="1" cores="4" threads="1"/>
|
||||
</cpu>
|
||||
<clock offset="localtime"/>
|
||||
<pm>
|
||||
|
@ -29,18 +29,18 @@ def test_misc_cpu_topology():
|
||||
cpu.topology.sockets = "2"
|
||||
cpu.set_topology_defaults(6)
|
||||
def get_top(_c):
|
||||
return [_c.topology.sockets, _c.topology.cores, _c.topology.threads]
|
||||
assert get_top(cpu) == [2, 3, 1]
|
||||
return [_c.topology.sockets, _c.topology.dies, _c.topology.cores, _c.topology.threads]
|
||||
assert get_top(cpu) == [2, 1, 3, 1]
|
||||
|
||||
cpu = virtinst.DomainCpu(conn)
|
||||
cpu.topology.cores = "4"
|
||||
cpu.set_topology_defaults(9)
|
||||
assert get_top(cpu) == [2, 4, 1]
|
||||
assert get_top(cpu) == [2, 1, 4, 1]
|
||||
|
||||
cpu = virtinst.DomainCpu(conn)
|
||||
cpu.topology.threads = "3"
|
||||
cpu.set_topology_defaults(14)
|
||||
assert get_top(cpu) == [4, 1, 3]
|
||||
assert get_top(cpu) == [4, 1, 1, 3]
|
||||
|
||||
cpu = virtinst.DomainCpu(conn)
|
||||
cpu.topology.sockets = 5
|
||||
|
@ -35,6 +35,9 @@ class _CPUTopology(XMLBuilder):
|
||||
else:
|
||||
self.sockets = vcpus // self.cores
|
||||
|
||||
if not self.dies:
|
||||
self.dies = 1
|
||||
|
||||
if not self.cores:
|
||||
if not self.threads:
|
||||
self.cores = vcpus // self.sockets
|
||||
|
Loading…
x
Reference in New Issue
Block a user