@@ -39,28 +39,28 @@ const (
39
39
var IPv4loopback1 = net .IPv4 (127 , 0 , 0 , 1 )
40
40
41
41
func defaultCPUType () CPUType {
42
- cpuType := map [Arch ]string {
43
- AARCH64 : "cortex-a72" ,
44
- ARMV7L : "cortex-a7" ,
42
+ cpuType := map [Arch ]* string {
43
+ AARCH64 : ptr . Of ( "cortex-a72" ) ,
44
+ ARMV7L : ptr . Of ( "cortex-a7" ) ,
45
45
// Since https://github.com/lima-vm/lima/pull/494, we use qemu64 cpu for better emulation of x86_64.
46
- X8664 : "qemu64" ,
47
- RISCV64 : "rv64" , // FIXME: what is the right choice for riscv64?
46
+ X8664 : ptr . Of ( "qemu64" ) ,
47
+ RISCV64 : ptr . Of ( "rv64" ) , // FIXME: what is the right choice for riscv64?
48
48
}
49
49
for arch := range cpuType {
50
50
if IsNativeArch (arch ) && IsAccelOS () {
51
51
if HasHostCPU () {
52
- cpuType [arch ] = "host"
52
+ cpuType [arch ] = ptr . Of ( "host" )
53
53
} else if HasMaxCPU () {
54
- cpuType [arch ] = "max"
54
+ cpuType [arch ] = ptr . Of ( "max" )
55
55
}
56
56
}
57
57
if arch == X8664 && runtime .GOOS == "darwin" {
58
- switch cpuType [arch ] {
58
+ switch * cpuType [arch ] {
59
59
case "host" , "max" :
60
60
// Disable pdpe1gb on Intel Mac
61
61
// https://github.com/lima-vm/lima/issues/1485
62
62
// https://stackoverflow.com/a/72863744/5167443
63
- cpuType [arch ] += ",-pdpe1gb"
63
+ * cpuType [arch ] += ",-pdpe1gb"
64
64
}
65
65
}
66
66
}
@@ -217,19 +217,19 @@ func FillDefault(y, d, o *LimaYAML, filePath string) {
217
217
cpuType := defaultCPUType ()
218
218
var overrideCPUType bool
219
219
for k , v := range d .CPUType {
220
- if len (v ) > 0 {
220
+ if v != nil && len (* v ) > 0 {
221
221
overrideCPUType = true
222
222
cpuType [k ] = v
223
223
}
224
224
}
225
225
for k , v := range y .CPUType {
226
- if len (v ) > 0 {
226
+ if v != nil && len (* v ) > 0 {
227
227
overrideCPUType = true
228
228
cpuType [k ] = v
229
229
}
230
230
}
231
231
for k , v := range o .CPUType {
232
- if len (v ) > 0 {
232
+ if v != nil && len (* v ) > 0 {
233
233
overrideCPUType = true
234
234
cpuType [k ] = v
235
235
}
0 commit comments