summaryrefslogtreecommitdiff
path: root/gnu/build/vm.scm
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2016-02-27 08:52:23 -0500
committerMark H Weaver <mhw@netris.org>2016-02-27 08:52:23 -0500
commit048ec1a8b092a87de08bfe410be65642522b63ed (patch)
tree1279c4fa3fd09805dbfe06be3514879aa38d503e /gnu/build/vm.scm
parentfe5f687284889eeff3c1b73edab0aa26e58c3bc5 (diff)
parentb35461748b20d0172744974b39e7d9d033400c51 (diff)
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/build/vm.scm')
-rw-r--r--gnu/build/vm.scm19
1 files changed, 14 insertions, 5 deletions
diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index a095f9de8a..48e701adbe 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -1,5 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
+;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -97,7 +99,7 @@ the #:references-graphs parameter of 'derivation'."
(_ #f))
(unless (zero?
- (apply system* qemu "-enable-kvm" "-nographic" "-no-reboot"
+ (apply system* qemu "-nographic" "-no-reboot"
"-m" (number->string memory-size)
"-net" "nic,model=virtio"
"-virtfs"
@@ -111,10 +113,17 @@ the #:references-graphs parameter of 'derivation'."
"-initrd" initrd
"-append" (string-append "console=ttyS0 --load="
builder)
- (if make-disk-image?
- `("-drive" ,(string-append "file=" image-file
- ",if=virtio"))
- '())))
+ (append
+ (if make-disk-image?
+ `("-drive" ,(string-append "file=" image-file
+ ",if=virtio"))
+ '())
+ ;; Only enable kvm if we see /dev/kvm exists.
+ ;; This allows users without hardware virtualization to still
+ ;; use these commands.
+ (if (file-exists? "/dev/kvm")
+ '("-enable-kvm")
+ '()))))
(error "qemu failed" qemu))
(if make-disk-image?