4 * Copyright Red Hat, Inc. 2012
5 * Copyright Amit Shah <amit.shah@redhat.com>
7 * This work is licensed under the terms of the GNU GPL, version 2 or
8 * (at your option) any later version. See the COPYING file in the
12 #ifndef QEMU_VIRTIO_RNG_H
13 #define QEMU_VIRTIO_RNG_H
15 #include "hw/virtio/virtio.h"
16 #include "sysemu/rng.h"
17 #include "standard-headers/linux/virtio_rng.h"
18 #include "qom/object.h"
20 #define TYPE_VIRTIO_RNG "virtio-rng-device"
21 OBJECT_DECLARE_SIMPLE_TYPE(VirtIORNG
, VIRTIO_RNG
)
22 #define VIRTIO_RNG_GET_PARENT_CLASS(obj) \
23 OBJECT_GET_PARENT_CLASS(obj, TYPE_VIRTIO_RNG)
25 struct VirtIORNGConf
{
32 VirtIODevice parent_obj
;
34 /* Only one vq - guest puts buffer(s) on it when it needs entropy */
41 /* We purposefully don't migrate this state. The quota will reset on the
42 * destination as a result. Rate limiting is host state, not guest state.
44 QEMUTimer
*rate_limit_timer
;
45 int64_t quota_remaining
;
48 VMChangeStateEntry
*vmstate
;