Statistics
| Branch: | Revision:

root / hw / virtio-rng.c @ 5e22c276

History | View | Annotate | Download (4.9 kB)

# Date Author Comment
1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

e1f7b481 11/30/2012 01:25 am Michael S. Tsirkin

virtio: limit avail bytes lookahead

Commit 0d8d7690850eb0cf2b2b60933cf47669a6b6f18f introduced
a regression in virtio-net performance because it looks
into the ring aggressively while we really only care
about a single packet worth of buffers.
Reported as bugzilla 1066055 in launchpad....

03a36f17 11/27/2012 04:51 pm Paolo Bonzini

virtio-rng: do not use g_assert_cmpint

g_assert_cmpint is not available on glib 2.12, which is the minimum
version required to build QEMU (we only require 2.16 to run tests,
since that is the first version including GTester). Do not use it
in hardware models, use a normal assertion instead....

14417039 11/26/2012 10:26 pm Amit Shah

virtio-rng: use virtqueue_get_avail_bytes, fix migration

Popping an elem from the vq just to find out its length causes problems
with save/load later on. Use the new virtqueue_get_avail_bytes()
function instead, saves us the complexity in the migration code, as well...

4621c176 11/26/2012 10:26 pm Amit Shah

virtio-rng: remove extra request for entropy

If we got fewer bytes from the backend than requested, don't poke the
backend for more bytes; the guest will ask for more (or if the guest has
already asked for more, the backend knows about it via handle_input())....

8cc67743 11/26/2012 10:26 pm Amit Shah

virtio-rng: disable timer on device removal

Disable the rate-limit timer on device remove (e.g. hot-unplug).

Signed-off-by: Amit Shah <>
Reviewed-by: Anthony Liguori <>
Signed-off-by: Anthony Liguori <>

42015c9a 11/26/2012 10:26 pm Amit Shah

virtio-rng: fix typos, comments

Fix typos, whitespace and update comments to match current
implementation.

Signed-off-by: Amit Shah <>
Signed-off-by: Anthony Liguori <>

16c915ba 11/16/2012 04:36 pm Amit Shah

virtio-rng: hardware random number generator device

The Linux kernel already has a virtio-rng driver, this is the device
implementation.

When the guest asks for entropy from the virtio hwrng, it puts a buffer
in the vq. We then put entropy into that buffer, and push it back to...

904d6f58 11/16/2012 04:36 pm Anthony Liguori

virtio-rng: add rate limiting support

This adds parameters to virtio-rng-pci to allow rate limiting the entropy a
guest receives. An example command line:

$ qemu -device virtio-rng-pci,max-bytes=1024,period=1000

Would limit entropy collection to 1Kb/s....