From ca03d6881a7d4c39ef72950dae72dbdbe886f959 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 20 Apr 2018 20:01:15 +0200 Subject: vm/qemu: don't be too clever with cpu configuration Some machine configurations have strict limits on number of CPUs and don't support NUMA (e.g. arm vexpress-a15). maxcpu and numa options make qemu fail. Don't be too clever. If necessary maxcpu and numa options can be added in qemu_args. --- vm/qemu/qemu.go | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/vm/qemu/qemu.go b/vm/qemu/qemu.go index 4173e2c6f..9e27bd40c 100644 --- a/vm/qemu/qemu.go +++ b/vm/qemu/qemu.go @@ -237,27 +237,13 @@ func (inst *instance) Boot() error { } args := []string{ "-m", strconv.Itoa(inst.cfg.Mem), + "-smp", strconv.Itoa(inst.cfg.CPU), "-net", "nic", "-net", fmt.Sprintf("user,host=%v,hostfwd=tcp::%v-:22", hostAddr, inst.port), "-display", "none", "-serial", "stdio", "-no-reboot", } - if inst.cfg.CPU == 1 { - args = append(args, - "-smp", "cpus=1,maxcpus=2", - ) - } else { - ncores := 1 - if inst.cfg.CPU >= 4 { - ncores = 2 - } - args = append(args, - "-numa", "node,nodeid=0", "-numa", "node,nodeid=1", - "-smp", fmt.Sprintf("cpus=%v,maxcpus=%v,sockets=2,cores=%v", - inst.cfg.CPU, inst.cfg.CPU+1, ncores), - ) - } args = append(args, strings.Split(inst.cfg.Qemu_Args, " ")...) if inst.image == "9p" { args = append(args, -- cgit mrf-deployment