aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-04-20 20:01:15 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-04-20 20:14:10 +0200
commitca03d6881a7d4c39ef72950dae72dbdbe886f959 (patch)
treef798b61cb216d60653728ae8da76ae9a2b987506
parent8b9a3f2c765b19db76e260675f41606763ea9712 (diff)
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.
-rw-r--r--vm/qemu/qemu.go16
1 files changed, 1 insertions, 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,