qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 3/3] virtio-rng: change default backend to rn


From: Laurent Vivier
Subject: Re: [Qemu-devel] [PATCH v3 3/3] virtio-rng: change default backend to rng-builtin
Date: Mon, 13 May 2019 12:26:47 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 10/05/2019 18:36, Markus Armbruster wrote:
Laurent Vivier <address@hidden> writes:

Signed-off-by: Laurent Vivier <address@hidden>
---
  backends/rng-builtin.c         |  8 +++-----
  hw/virtio/virtio-rng.c         |  2 +-
  include/hw/virtio/virtio-rng.h |  4 ++--
  include/sysemu/rng-builtin.h   | 17 +++++++++++++++++
  qemu-options.hx                |  5 ++---
  5 files changed, 25 insertions(+), 11 deletions(-)
  create mode 100644 include/sysemu/rng-builtin.h
...
diff --git a/include/hw/virtio/virtio-rng.h b/include/hw/virtio/virtio-rng.h
index 922dce7caccf..f9b6339b19a4 100644
--- a/include/hw/virtio/virtio-rng.h
+++ b/include/hw/virtio/virtio-rng.h
...
  #define TYPE_VIRTIO_RNG "virtio-rng-device"
@@ -26,7 +26,7 @@ struct VirtIORNGConf {
      RngBackend *rng;
      uint64_t max_bytes;
      uint32_t period_ms;
-    RngRandom *default_backend;
+    RngBuiltin *default_backend;

This member appears to be superfluous.  As far as I can tell, it's only
used in the part of virtio-rng.c visible above.  If you replace it by a
local variable there (in a separate patch, perhaps), this patch will
become simpler.  In particular, you won't need to create rng-builtin.h.


I don't understand how we can remove the rng-builtin.h as we need its macros for "RNG_BUILTIN(object_new(TYPE_RNG_BUILTIN))". Could you explain?

Thanks,
Laurent



reply via email to

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