-
Notifications
You must be signed in to change notification settings - Fork 693
Not all OS with -accel has -cpu host option #900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
pkg/limayaml/defaults.go
Outdated
if HasHostCPU() { | ||
cpuType[arch] = "host" | ||
} else { | ||
cpuType[arch] = "max" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be a function, as the logic is duplicated in the test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the flags and functions are a bit spread out between qemu and limayaml
pkg/limayaml/defaults.go
Outdated
if HasHostCPU() { | ||
cpuType[arch] = "host" | ||
} else { | ||
cpuType[arch] = "max" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably better to leave empty (QEMU default)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean remove -cpu
argument altogether ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
@@ -106,7 +106,9 @@ func FillDefault(y, d, o *LimaYAML, filePath string) { | |||
} | |||
for arch := range cpuType { | |||
if IsNativeArch(arch) && IsAccelOS() { | |||
cpuType[arch] = "host" | |||
if HasHostCPU() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can merge this if
to the if
in the previous line
@@ -84,7 +84,9 @@ func TestFillDefault(t *testing.T) { | |||
}, | |||
} | |||
if IsAccelOS() { | |||
builtin.CPUType[arch] = "host" | |||
if HasHostCPU() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, you can merge this if
to the if
in the previous line
Instead use -cpu max, for everything available.
Affects NetBSD (NVMM) and Windows (WHPX)
Follow-up from #894