summaryrefslogtreecommitdiffstats
path: root/hw/virtio-rng.c
Commit message (Collapse)AuthorAgeFilesLines
* misc: move include files to include/qemu/Paolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* virtio: limit avail bytes lookaheadMichael S. Tsirkin2012-11-291-3/+9
| | | | | | | | | | | | | | | | | 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. To fix, add parameters limiting lookahead, and use in virtqueue_avail_bytes. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reported-by: Edivaldo de Araujo Pereira <edivaldoapereira@yahoo.com.br> Tested-by: Edivaldo de Araujo Pereira <edivaldoapereira@yahoo.com.br> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-rng: do not use g_assert_cmpintPaolo Bonzini2012-11-271-2/+1
| | | | | | | | | | | | 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. This fixes the buildbot failure for default_x86_64_rhel5. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-rng: fix typos, commentsAmit Shah2012-11-261-4/+3
| | | | | | | | Fix typos, whitespace and update comments to match current implementation. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-rng: disable timer on device removalAmit Shah2012-11-261-0/+2
| | | | | | | | Disable the rate-limit timer on device remove (e.g. hot-unplug). Signed-off-by: Amit Shah <amit.shah@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-rng: remove extra request for entropyAmit Shah2012-11-261-7/+0
| | | | | | | | | | 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()). Signed-off-by: Amit Shah <amit.shah@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-rng: use virtqueue_get_avail_bytes, fix migrationAmit Shah2012-11-261-64/+12
| | | | | | | | | | | 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 as makes the migration endian-safe. Signed-off-by: Amit Shah <amit.shah@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-rng: add rate limiting supportAnthony Liguori2012-11-161-8/+55
| | | | | | | | | | | 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. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* virtio-rng: hardware random number generator deviceAmit Shah2012-11-161-0/+211
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 the guest. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> --- aliguori: converted to new RngBackend interface aliguori: remove entropy needed event aliguori: fix migration
OpenPOWER on IntegriCloud