qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 38/61] virtio-rng : show the VirtIORNG structure.


From: fred . konrad
Subject: [Qemu-devel] [PATCH 38/61] virtio-rng : show the VirtIORNG structure.
Date: Mon, 7 Jan 2013 19:40:51 +0100

From: KONRAD Frederic <address@hidden>

As we discuss with anthony and andreas, this structure must be showed to avoid
two memory allocations for virtio-rng-x.

Signed-off-by: KONRAD Frederic <address@hidden>
---
 hw/virtio-rng.c | 19 -------------------
 hw/virtio-rng.h | 19 +++++++++++++++++++
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/hw/virtio-rng.c b/hw/virtio-rng.c
index e063127..d79aa46 100644
--- a/hw/virtio-rng.c
+++ b/hw/virtio-rng.c
@@ -15,25 +15,6 @@
 #include "virtio-rng.h"
 #include "qemu/rng.h"
 
-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;
-
 static bool is_guest_ready(VirtIORNG *vrng)
 {
     if (virtio_queue_ready(vrng->vq)
diff --git a/hw/virtio-rng.h b/hw/virtio-rng.h
index f42d748..3711c97 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
-- 
1.7.11.7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]