diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2020-09-21 18:10:25 -0400 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2020-10-13 15:56:30 -0400 |
commit | a3d3ee6c1357749013aa700c929682f41475b158 (patch) | |
tree | 089b4fe7b44a6836a619da246cb6adc22e8803a2 | |
parent | 079eed2e77559582aceece5830b124be1f261922 (diff) | |
download | qemu-a3d3ee6c1357749013aa700c929682f41475b158.zip qemu-a3d3ee6c1357749013aa700c929682f41475b158.tar.gz qemu-a3d3ee6c1357749013aa700c929682f41475b158.tar.bz2 |
rng-random: register "filename" 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-5-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-rw-r--r-- | backends/rng-random.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/backends/rng-random.c b/backends/rng-random.c index 245b12a..7add272 100644 --- a/backends/rng-random.c +++ b/backends/rng-random.c @@ -108,10 +108,6 @@ static void rng_random_init(Object *obj) { RngRandom *s = RNG_RANDOM(obj); - object_property_add_str(obj, "filename", - rng_random_get_filename, - rng_random_set_filename); - s->filename = g_strdup("/dev/urandom"); s->fd = -1; } @@ -134,6 +130,10 @@ static void rng_random_class_init(ObjectClass *klass, void *data) rbc->request_entropy = rng_random_request_entropy; rbc->opened = rng_random_opened; + object_class_property_add_str(klass, "filename", + rng_random_get_filename, + rng_random_set_filename); + } static const TypeInfo rng_random_info = { |