mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 12:06:01 +01:00
Merge pull request #13852 from lovesegfault/warn-no-kvm
feat(libstore): warn when kvm is enabled but /dev/kvm isn't available
This commit is contained in:
commit
a0103fc302
1 changed files with 11 additions and 2 deletions
|
|
@ -3,6 +3,7 @@
|
||||||
# include "nix/store/personality.hh"
|
# include "nix/store/personality.hh"
|
||||||
# include "nix/util/cgroup.hh"
|
# include "nix/util/cgroup.hh"
|
||||||
# include "nix/util/linux-namespaces.hh"
|
# include "nix/util/linux-namespaces.hh"
|
||||||
|
# include "nix/util/logging.hh"
|
||||||
# include "linux/fchmodat2-compat.hh"
|
# include "linux/fchmodat2-compat.hh"
|
||||||
|
|
||||||
# include <sys/ioctl.h>
|
# include <sys/ioctl.h>
|
||||||
|
|
@ -505,8 +506,16 @@ struct ChrootLinuxDerivationBuilder : ChrootDerivationBuilder, LinuxDerivationBu
|
||||||
createDirs(chrootRootDir + "/dev/shm");
|
createDirs(chrootRootDir + "/dev/shm");
|
||||||
createDirs(chrootRootDir + "/dev/pts");
|
createDirs(chrootRootDir + "/dev/pts");
|
||||||
ss.push_back("/dev/full");
|
ss.push_back("/dev/full");
|
||||||
if (systemFeatures.count("kvm") && pathExists("/dev/kvm"))
|
if (systemFeatures.count("kvm")) {
|
||||||
ss.push_back("/dev/kvm");
|
if (pathExists("/dev/kvm")) {
|
||||||
|
ss.push_back("/dev/kvm");
|
||||||
|
} else {
|
||||||
|
warn(
|
||||||
|
"KVM is enabled in system-features but /dev/kvm is not available. "
|
||||||
|
"QEMU builds may fall back to slow emulation. "
|
||||||
|
"Consider removing 'kvm' from system-features in nix.conf if KVM is not supported on this system.");
|
||||||
|
}
|
||||||
|
}
|
||||||
ss.push_back("/dev/null");
|
ss.push_back("/dev/null");
|
||||||
ss.push_back("/dev/random");
|
ss.push_back("/dev/random");
|
||||||
ss.push_back("/dev/tty");
|
ss.push_back("/dev/tty");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue