Skip to content
Snippets Groups Projects
Commit 29ee2a18 authored by Eduardo Habkost's avatar Eduardo Habkost
Browse files

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: default avatarEduardo Habkost <ehabkost@redhat.com>
Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200921221045.699690-8-ehabkost@redhat.com>
Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
parent a3d3ee6c
No related branches found
No related tags found
No related merge requests found
......@@ -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 = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment