virtcontainers: fix invalid CPU topology

sockets * cores * threads should be equal to maxcpus otherwise a
warning is thrown: 'warning: Invalid CPU topology deprecated:
    sockets * cores * threads != maxcpus'

This warning in the future will be an error and won't be possible to run
kata containers.

fixes #1605

Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
Julio Montes 2019-04-29 14:16:22 -05:00
parent 437b3cb2f7
commit fa5de87d84
2 changed files with 2 additions and 2 deletions

View File

@ -257,7 +257,7 @@ func (q *qemuArchBase) bridges(number uint32) []types.PCIBridge {
func (q *qemuArchBase) cpuTopology(vcpus, maxvcpus uint32) govmmQemu.SMP { func (q *qemuArchBase) cpuTopology(vcpus, maxvcpus uint32) govmmQemu.SMP {
smp := govmmQemu.SMP{ smp := govmmQemu.SMP{
CPUs: vcpus, CPUs: vcpus,
Sockets: vcpus, Sockets: maxvcpus,
Cores: defaultCores, Cores: defaultCores,
Threads: defaultThreads, Threads: defaultThreads,
MaxCPUs: maxvcpus, MaxCPUs: maxvcpus,

View File

@ -165,7 +165,7 @@ func TestQemuArchBaseCPUTopology(t *testing.T) {
expectedSMP := govmmQemu.SMP{ expectedSMP := govmmQemu.SMP{
CPUs: vcpus, CPUs: vcpus,
Sockets: vcpus, Sockets: defaultMaxQemuVCPUs,
Cores: defaultCores, Cores: defaultCores,
Threads: defaultThreads, Threads: defaultThreads,
MaxCPUs: defaultMaxQemuVCPUs, MaxCPUs: defaultMaxQemuVCPUs,