qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	"Daniel P. Berrange" <berrange@redhat.com>
Subject: [PULL 01/10] rng-egd: Register "chardev" as class property
Date: Wed, 14 Oct 2020 10:34:06 -0400	[thread overview]
Message-ID: <20201014143415.240472-2-ehabkost@redhat.com> (raw)
In-Reply-To: <20201014143415.240472-1-ehabkost@redhat.com>

Class properties make QOM introspection simpler and easier, as
they don't require an object to be instantiated.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200921221045.699690-4-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 backends/rng-egd.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/backends/rng-egd.c b/backends/rng-egd.c
index 20198ff26e..4de142b9dc 100644
--- a/backends/rng-egd.c
+++ b/backends/rng-egd.c
@@ -135,12 +135,6 @@ static char *rng_egd_get_chardev(Object *obj, Error **errp)
     return NULL;
 }
 
-static void rng_egd_init(Object *obj)
-{
-    object_property_add_str(obj, "chardev",
-                            rng_egd_get_chardev, rng_egd_set_chardev);
-}
-
 static void rng_egd_finalize(Object *obj)
 {
     RngEgd *s = RNG_EGD(obj);
@@ -155,6 +149,8 @@ static void rng_egd_class_init(ObjectClass *klass, void *data)
 
     rbc->request_entropy = rng_egd_request_entropy;
     rbc->opened = rng_egd_opened;
+    object_class_property_add_str(klass, "chardev",
+                                  rng_egd_get_chardev, rng_egd_set_chardev);
 }
 
 static const TypeInfo rng_egd_info = {
@@ -162,7 +158,6 @@ static const TypeInfo rng_egd_info = {
     .parent = TYPE_RNG_BACKEND,
     .instance_size = sizeof(RngEgd),
     .class_init = rng_egd_class_init,
-    .instance_init = rng_egd_init,
     .instance_finalize = rng_egd_finalize,
 };
 
-- 
2.28.0



  reply	other threads:[~2020-10-14 14:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-14 14:34 [PULL 00/10] machine + QOM queue, 2020-10-14 Eduardo Habkost
2020-10-14 14:34 ` Eduardo Habkost [this message]
2020-10-14 14:34 ` [PULL 02/10] rng-random: register "filename" as class property Eduardo Habkost
2020-10-14 14:34 ` [PULL 03/10] rng: Register "opened" " Eduardo Habkost
2020-10-14 14:34 ` [PULL 04/10] input-linux: Register properties as class properties Eduardo Habkost
2020-10-14 14:34 ` [PULL 05/10] input-barrier: " Eduardo Habkost
2020-10-14 14:34 ` [PULL 06/10] i386: Register most CPU " Eduardo Habkost
2020-10-14 14:34 ` [PULL 07/10] vga-pci: Register "big-endian-framebuffer" as class property Eduardo Habkost
2020-10-14 14:34 ` [PULL 08/10] vhost-user: Register "chardev" " Eduardo Habkost
2020-10-14 14:34 ` [PULL 09/10] authz-list-file: Fix crash when filename is not set Eduardo Habkost
2020-10-14 14:34 ` [PULL 10/10] can-host-socketcan: Fix crash when 'if' option " Eduardo Habkost
2020-10-15 19:30 ` [PULL 00/10] machine + QOM queue, 2020-10-14 Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201014143415.240472-2-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=berrange@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).