guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Making /dev/kvm optional


From: Ludovic Courtès
Subject: [PATCH] Making /dev/kvm optional
Date: Fri, 21 Mar 2014 13:54:53 +0100
User-agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux)

Hello,

The daemon now creates /dev deterministically (thanks!).  However, it
expects /dev/kvm to be present.

The patch below restricts that requirement (1) to Linux-based systems,
and (2) to systems where /dev/kvm already exists.

I’m not sure about the way to handle (2).  We could special-case
/dev/kvm and create it (instead of bind-mounting it) in the chroot, so
it’s always available; however, it wouldn’t help much since most likely,
if /dev/kvm missing, then KVM support is missing.

Thoughts?

Thanks,
Ludo’.

diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 973e7a1..e846995 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -2020,7 +2020,10 @@ void DerivationGoal::initChild()
                 createDirs(chrootRootDir + "/dev/pts");
                 Strings ss;
                 ss.push_back("/dev/full");
-                ss.push_back("/dev/kvm");
+#ifdef __linux__
+                if (pathExists("/dev/kvm"))
+                    ss.push_back("/dev/kvm");
+#endif
                 ss.push_back("/dev/null");
                 ss.push_back("/dev/random");
                 ss.push_back("/dev/tty");

reply via email to

[Prev in Thread] Current Thread [Next in Thread]