]> git.proxmox.com Git - qemu-server.git/commit
rng: die when trying to pass through disconnected hwrng
authorStefan Reiter <s.reiter@proxmox.com>
Tue, 5 May 2020 14:53:12 +0000 (16:53 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 6 May 2020 12:23:04 +0000 (14:23 +0200)
commit058531889fee773a94b1fc3c508705c35a3a1625
tree016a0bf78953bb677833f767ec0420489bd2242d
parent6bb12239cc7686a883e069508035194e3645ee41
rng: die when trying to pass through disconnected hwrng

If /dev/hwrng exists, but no actual generator is connected (or it is
disabled on the host), QEMU will happily start the VM but crash as soon
as the guest accesses the VirtIO RNG device.

To prevent this unfortunate behaviour, check if a useable hwrng is
connected to the host before allowing the VM to be started.

While at it, clean up config_to_command by moving new and existing rng
source checks to a seperate sub.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
PVE/QemuServer.pm