summary refs log tree commit diff stats
path: root/hw/virtio-rng.h
diff options
context:
space:
mode:
Diffstat (limited to 'hw/virtio-rng.h')
-rw-r--r--hw/virtio-rng.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/hw/virtio-rng.h b/hw/virtio-rng.h
index f42d748eba..3711c97a70 100644
--- a/hw/virtio-rng.h
+++ b/hw/virtio-rng.h
@@ -25,4 +25,23 @@ struct VirtIORNGConf {
     RndRandom *default_backend;
 };
 
+typedef struct VirtIORNG {
+    VirtIODevice vdev;
+
+    DeviceState *qdev;
+
+    /* Only one vq - guest puts buffer(s) on it when it needs entropy */
+    VirtQueue *vq;
+
+    VirtIORNGConf *conf;
+
+    RngBackend *rng;
+
+    /* We purposefully don't migrate this state.  The quota will reset on the
+     * destination as a result.  Rate limiting is host state, not guest state.
+     */
+    QEMUTimer *rate_limit_timer;
+    int64_t quota_remaining;
+} VirtIORNG;
+
 #endif