aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-09-21 18:10:28 -0400
committerEduardo Habkost <ehabkost@redhat.com>2020-10-13 15:56:30 -0400
commit29ee2a183205062f8b5b5b317e7fe392e9f57e64 (patch)
tree98ba05d3c0ba916b3ddbf61f0c936883334522e2
parenta3d3ee6c1357749013aa700c929682f41475b158 (diff)
rng: Register "opened" as class property
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-8-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-rw-r--r--backends/rng.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/backends/rng.c b/backends/rng.c
index 484f04e891..3757b04485 100644
--- a/backends/rng.c
+++ b/backends/rng.c
@@ -105,10 +105,6 @@ static void rng_backend_init(Object *obj)
RngBackend *s = RNG_BACKEND(obj);
QSIMPLEQ_INIT(&s->requests);
-
- object_property_add_bool(obj, "opened",
- rng_backend_prop_get_opened,
- rng_backend_prop_set_opened);
}
static void rng_backend_finalize(Object *obj)
@@ -123,6 +119,10 @@ static void rng_backend_class_init(ObjectClass *oc, void *data)
UserCreatableClass *ucc = USER_CREATABLE_CLASS(oc);
ucc->complete = rng_backend_complete;
+
+ object_class_property_add_bool(oc, "opened",
+ rng_backend_prop_get_opened,
+ rng_backend_prop_set_opened);
}
static const TypeInfo rng_backend_info = {