guix-commits
[Top][All Lists]
Advanced

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

01/01: vm: Pass the host's /dev/urandom to the guest at /dev/hwrng.


From: Leo Famulari
Subject: 01/01: vm: Pass the host's /dev/urandom to the guest at /dev/hwrng.
Date: Mon, 18 Dec 2017 00:40:02 -0500 (EST)

lfam pushed a commit to branch master
in repository guix.

commit 2ca712bdbae5551a270c17522da20e8cb84a29cf
Author: Leo Famulari <address@hidden>
Date:   Sat Dec 2 20:17:45 2017 -0500

    vm: Pass the host's /dev/urandom to the guest at /dev/hwrng.
    
    * gnu/build/vm.scm (load-in-linux-vm): Use QEMU's virtio-rng-pci.
    * gnu/system/vm.scm (common-qemu-options): Likewise.
---
 gnu/build/vm.scm  | 4 +++-
 gnu/system/vm.scm | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index 8f8ca60..404f324 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <address@hidden>
 ;;; Copyright © 2016 Christopher Allan Webber <address@hidden>
-;;; Copyright © 2016 Leo Famulari <address@hidden>
+;;; Copyright © 2016, 2017 Leo Famulari <address@hidden>
 ;;; Copyright © 2017 Mathieu Othacehe <address@hidden>
 ;;; Copyright © 2017 Marius Bakke <address@hidden>
 ;;;
@@ -139,6 +139,8 @@ the #:references-graphs parameter of 'derivation'."
   (unless (zero?
            (apply system* qemu "-nographic" "-no-reboot"
                   "-m" (number->string memory-size)
+                  "-object" "rng-random,filename=/dev/urandom,id=guixsd-vm-rng"
+                  "-device" "virtio-rng-pci,rng=guixsd-vm-rng"
                   "-virtfs"
                   (string-append "local,id=store_dev,path="
                                  (%store-directory)
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index c1305d3..53629da 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <address@hidden>
 ;;; Copyright © 2016 Christopher Allan Webber <address@hidden>
-;;; Copyright © 2016 Leo Famulari <address@hidden>
+;;; Copyright © 2016, 2017 Leo Famulari <address@hidden>
 ;;; Copyright © 2017 Mathieu Othacehe <address@hidden>
 ;;; Copyright © 2017 Marius Bakke <address@hidden>
 ;;;
@@ -666,6 +666,8 @@ with '-virtfs' options for the host file systems listed in 
SHARED-FS."
 
      "-no-reboot"
      "-net nic,model=virtio"
+     "-object" "rng-random,filename=/dev/urandom,id=guixsd-vm-rng"
+     "-device" "virtio-rng-pci,rng=guixsd-vm-rng"
 
      #$@(map virtfs-option shared-fs)
      "-vga std"



reply via email to

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