Skip to content

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

Merged
merged 1 commit into from
Jun 19, 2022

Conversation

afbjorklund
Copy link
Member

Instead use -cpu max, for everything available.

Affects NetBSD (NVMM) and Windows (WHPX)

Follow-up from #894

Comment on lines 109 to 111
if HasHostCPU() {
cpuType[arch] = "host"
} else {
cpuType[arch] = "max"
}
Copy link
Member

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?

Copy link
Member Author

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

if HasHostCPU() {
cpuType[arch] = "host"
} else {
cpuType[arch] = "max"
Copy link
Member

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)

Copy link
Member Author

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 ?

Copy link
Member

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() {
Copy link
Member

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() {
Copy link
Member

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

@AkihiroSuda AkihiroSuda merged commit 6410674 into lima-vm:master Jun 19, 2022
@AkihiroSuda AkihiroSuda added this to the v0.11.1 milestone Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants