From 72bd0b175b0433cd8e02fc84da78452f80a53cd4 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Tue, 15 May 2018 17:22:24 -0400 Subject: [PATCH] build_library: attach virtio-rng-pci device to QEMU VMs Pass /dev/urandom through to QEMU VMs. (Not /dev/random, to avoid draining the host's entropy.) This speeds initialization of VM entropy. --- build_library/qemu_template.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build_library/qemu_template.sh b/build_library/qemu_template.sh index b846b4f4c4..2a4bee4f7d 100755 --- a/build_library/qemu_template.sh +++ b/build_library/qemu_template.sh @@ -220,6 +220,7 @@ case "${VM_BOARD}" in -m ${VM_MEMORY} \ -net nic,vlan=0,model=virtio \ -net user,vlan=0,hostfwd=tcp::"${SSH_PORT}"-:22,hostname="${VM_NAME}" \ + -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0 \ "$@" ;; arm64-usr) @@ -228,6 +229,7 @@ case "${VM_BOARD}" in -m ${VM_MEMORY} \ -netdev user,id=eth0,hostfwd=tcp::"${SSH_PORT}"-:22,hostname="${VM_NAME}" \ -device virtio-net-device,netdev=eth0 \ + -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0 \ "$@" ;; *) die "Unsupported arch" ;;