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.
This commit is contained in:
Benjamin Gilbert 2018-05-15 17:22:24 -04:00
parent 72780d8347
commit 72bd0b175b

View File

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