mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
rng-egd: Register "chardev" 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-4-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
96292515c0
commit
079eed2e77
1 changed files with 2 additions and 7 deletions
|
|
@ -135,12 +135,6 @@ static char *rng_egd_get_chardev(Object *obj, Error **errp)
|
||||||
return NULL;
|
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)
|
static void rng_egd_finalize(Object *obj)
|
||||||
{
|
{
|
||||||
RngEgd *s = RNG_EGD(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->request_entropy = rng_egd_request_entropy;
|
||||||
rbc->opened = rng_egd_opened;
|
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 = {
|
static const TypeInfo rng_egd_info = {
|
||||||
|
|
@ -162,7 +158,6 @@ static const TypeInfo rng_egd_info = {
|
||||||
.parent = TYPE_RNG_BACKEND,
|
.parent = TYPE_RNG_BACKEND,
|
||||||
.instance_size = sizeof(RngEgd),
|
.instance_size = sizeof(RngEgd),
|
||||||
.class_init = rng_egd_class_init,
|
.class_init = rng_egd_class_init,
|
||||||
.instance_init = rng_egd_init,
|
|
||||||
.instance_finalize = rng_egd_finalize,
|
.instance_finalize = rng_egd_finalize,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue