@@ -5,7 +5,6 @@ package qemu
55import (
66 "fmt"
77 "os"
8- "strconv"
98
109 "github.com/golang/glog"
1110 "github.com/hyperhq/runv/hypervisor"
@@ -28,15 +27,9 @@ func (qc *QemuContext) arguments(ctx *hypervisor.VmContext) []string {
2827 qc .cpus = boot .CPU
2928
3029 var machineClass , memParams , cpuParams string
31- if boot .HotAddCpuMem || boot .BootToBeTemplate || boot .BootFromTemplate {
32- machineClass = "pc-i440fx-2.1"
33- memParams = fmt .Sprintf ("size=%d,slots=1,maxmem=%dM" , boot .Memory , hypervisor .DefaultMaxMem ) // TODO set maxmem to the total memory of the system
34- cpuParams = fmt .Sprintf ("cpus=%d,maxcpus=%d" , boot .CPU , hypervisor .DefaultMaxCpus ) // TODO set it to the cpus of the system
35- } else {
36- machineClass = "pc-i440fx-2.0"
37- memParams = strconv .Itoa (boot .Memory )
38- cpuParams = strconv .Itoa (boot .CPU )
39- }
30+ machineClass = "pc-i440fx-2.1"
31+ memParams = fmt .Sprintf ("size=%d,slots=1,maxmem=%dM" , boot .Memory , hypervisor .DefaultMaxMem ) // TODO set maxmem to the total memory of the system
32+ cpuParams = fmt .Sprintf ("cpus=%d,maxcpus=%d" , boot .CPU , hypervisor .DefaultMaxCpus ) // TODO set it to the cpus of the system
4033
4134 cmdline := "console=ttyS0 panic=1 no_timer_check"
4235 params := []string {
@@ -78,7 +71,7 @@ func (qc *QemuContext) arguments(ctx *hypervisor.VmContext) []string {
7871 if boot .BootFromTemplate {
7972 params = append (params , "-S" , "-incoming" , fmt .Sprintf ("exec:cat %s" , boot .DevicesStatePath ))
8073 }
81- } else if boot . HotAddCpuMem {
74+ } else {
8275 nodeConfig := fmt .Sprintf ("node,nodeid=0,cpus=0-%d,mem=%d" , hypervisor .DefaultMaxCpus - 1 , boot .Memory )
8376 params = append (params , "-numa" , nodeConfig )
8477 }
0 commit comments