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>stable-6.0
parent
a3d3ee6c13
commit
29ee2a1832
|
@ -105,10 +105,6 @@ static void rng_backend_init(Object *obj)
|
||||||
RngBackend *s = RNG_BACKEND(obj);
|
RngBackend *s = RNG_BACKEND(obj);
|
||||||
|
|
||||||
QSIMPLEQ_INIT(&s->requests);
|
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)
|
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);
|
UserCreatableClass *ucc = USER_CREATABLE_CLASS(oc);
|
||||||
|
|
||||||
ucc->complete = rng_backend_complete;
|
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 = {
|
static const TypeInfo rng_backend_info = {
|
||||||
|
|
Loading…
Reference in New Issue