summaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorEduardo Habkost <[email protected]>2020-09-21 18:10:26 -0400
committerEduardo Habkost <[email protected]>2020-10-13 15:56:30 -0400
commitabb9369805fe1ebd4eb2d278555c8e06ef099b15 (patch)
treebd85627975eaa91d1a0da6e8afe1043902ca63b1 /backends
parent5949703709e79b779a403d8a5622c1989c86db1c (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 <[email protected]> Reviewed-by: Marc-AndrĂ© Lureau <[email protected]> Message-Id: <[email protected]> Signed-off-by: Eduardo Habkost <[email protected]>
Diffstat (limited to 'backends')
-rw-r--r--backends/vhost-user.c6
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,
};