Skip to content

[Backport release-21.05] qemu, runInLinuxVM: fix KVM availability check#148029

Merged
alyssais merged 2 commits intoNixOS:release-21.05from
mschwaig:backport-125948-to-release-21.05
Dec 1, 2021
Merged

[Backport release-21.05] qemu, runInLinuxVM: fix KVM availability check#148029
alyssais merged 2 commits intoNixOS:release-21.05from
mschwaig:backport-125948-to-release-21.05

Conversation

@mschwaig
Copy link
Member

This backports #125948 to release-21.05 since the label-triggered automatic process for that failed.

I removed the change from -cpu max to -cpu qemu64 (aaecb3b) here since 21.05 has qemu 6.0. and not the 6.1 release, which needs that workaround.

I'm assuming 21.05 should still get the other changes, please just close this PR if not.

KVM should only be considered abailable if /dev/kvm exists and
is read-writable by the user that is trying to launch it.

The previous check for existance only had the consequence that
on some Linux distributions running VMs with Nix's QEMU only worked
if KVM was NOT installed.

fixes NixOS#124371

(cherry picked from commit 0463922)
This fixes the qemu-kvm wrapper we add for convenience
silently not using KVM, when the system would support it
by at least leaving an indication in the log that the build ran
slower because it ran without KVM.

(cherry picked from commit 5718276)
@ofborg ofborg bot requested review from alyssais and edolstra November 30, 2021 16:31
@ofborg ofborg bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Nov 30, 2021
@alyssais alyssais merged commit 74bb9d6 into NixOS:release-21.05 Dec 1, 2021
@mschwaig mschwaig deleted the backport-125948-to-release-21.05 branch March 23, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants