Merge pull request #2686 from rn/random

qemu: Use /dev/urandom on Linux for virtio-rng-pci
This commit is contained in:
Justin Cormack 2017-11-06 15:26:46 +00:00 committed by GitHub
commit 7485f2b6bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -521,6 +521,12 @@ func buildQemuCmdline(config QemuConfig) (QemuConfig, []string) {
}
}
rng := "rng-random,id=rng0"
if runtime.GOOS == "linux" {
rng = rng + ",filename=/dev/urandom"
}
qemuArgs = append(qemuArgs, "-object", rng, "-device", "virtio-rng-pci,rng=rng0")
var lastDisk int
for i, d := range config.Disks {
index := i