unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: nix-dev <nix-dev@cs.uu.nl>
Cc: guix-devel <guix-devel@gnu.org>
Subject: [PATCH] Making /dev/kvm optional
Date: Fri, 21 Mar 2014 13:54:53 +0100	[thread overview]
Message-ID: <87d2hf4spu.fsf@gnu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 546 bytes --]

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’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 625 bytes --]

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");

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev

             reply	other threads:[~2014-03-21 12:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-21 12:54 Ludovic Courtès [this message]
2014-03-22 14:21 ` [PATCH] Making /dev/kvm optional Ludovic Courtès
2014-03-23 10:57   ` Andreas Enge
2014-03-23 20:19     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d2hf4spu.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=nix-dev@cs.uu.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).