On (Mon) 09 Dec 2013 [22:10:12], Amos Kong wrote: > Bugzilla: https://bugs.launchpad.net/qemu/+bug/1253563 > > We have a requests queue to cache the random data, but the second > will come in when the first request is returned, so we always > only have one items in the queue. It effects the performance. > > This patch changes the IOthread to fill a fixed buffer with > random data from egd socket, request_entropy() will return > data to virtio queue if buffer has available data. > > (test with a fast source, disguised egd socket) > # cat /dev/urandom | nc -l localhost 8003 > # qemu .. -chardev socket,host=localhost,port=8003,id=chr0 \ > -object rng-egd,chardev=chr0,id=rng0,buf_size=1024 \ > -device virtio-rng-pci,rng=rng0
First thing I can think of is the egd protocol has a length field in the header, and if that isn't properly filled, the results are bound to be erratic. I haven't been able to find a spec detailing the way egd API, perhaps Anthony knows how to best pass data to qemu via egd. Amit