@@ -5,7 +5,6 @@ package qemu
5
5
import (
6
6
"fmt"
7
7
"os"
8
- "strconv"
9
8
10
9
"github.com/golang/glog"
11
10
"github.com/hyperhq/runv/hypervisor"
@@ -28,15 +27,9 @@ func (qc *QemuContext) arguments(ctx *hypervisor.VmContext) []string {
28
27
qc .cpus = boot .CPU
29
28
30
29
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
40
33
41
34
cmdline := "console=ttyS0 panic=1 no_timer_check"
42
35
params := []string {
@@ -78,7 +71,7 @@ func (qc *QemuContext) arguments(ctx *hypervisor.VmContext) []string {
78
71
if boot .BootFromTemplate {
79
72
params = append (params , "-S" , "-incoming" , fmt .Sprintf ("exec:cat %s" , boot .DevicesStatePath ))
80
73
}
81
- } else if boot . HotAddCpuMem {
74
+ } else {
82
75
nodeConfig := fmt .Sprintf ("node,nodeid=0,cpus=0-%d,mem=%d" , hypervisor .DefaultMaxCpus - 1 , boot .Memory )
83
76
params = append (params , "-numa" , nodeConfig )
84
77
}
0 commit comments