diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2020-09-21 18:10:26 -0400 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2020-10-13 15:56:30 -0400 |
commit | abb9369805fe1ebd4eb2d278555c8e06ef099b15 (patch) | |
tree | bd85627975eaa91d1a0da6e8afe1043902ca63b1 | |
parent | 5949703709e79b779a403d8a5622c1989c86db1c (diff) |
vhost-user: 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: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200921221045.699690-6-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-rw-r--r-- | backends/vhost-user.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/backends/vhost-user.c b/backends/vhost-user.c index ae8362d721..b366610e16 100644 --- a/backends/vhost-user.c +++ b/backends/vhost-user.c @@ -175,9 +175,9 @@ static char *get_chardev(Object *obj, Error **errp) return NULL; } -static void vhost_user_backend_init(Object *obj) +static void vhost_user_backend_class_init(ObjectClass *oc, void *data) { - object_property_add_str(obj, "chardev", get_chardev, set_chardev); + object_class_property_add_str(oc, "chardev", get_chardev, set_chardev); } static void vhost_user_backend_finalize(Object *obj) @@ -195,7 +195,7 @@ static const TypeInfo vhost_user_backend_info = { .name = TYPE_VHOST_USER_BACKEND, .parent = TYPE_OBJECT, .instance_size = sizeof(VhostUserBackend), - .instance_init = vhost_user_backend_init, + .class_init = vhost_user_backend_class_init, .instance_finalize = vhost_user_backend_finalize, }; |