]> Git Repo - qemu.git/commitdiff
cryptodev-vhost-user: Register "chardev" as class property
authorEduardo Habkost <[email protected]>
Mon, 21 Sep 2020 22:10:22 +0000 (18:10 -0400)
committerEduardo Habkost <[email protected]>
Tue, 22 Sep 2020 20:46:09 +0000 (16:46 -0400)
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: Gonglei <[email protected]>
Message-Id: <20200921221045[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
backends/cryptodev-vhost-user.c

index 60ec4908aa13b90cbdde7c3b9c31aaebf219c69e..e1df073de2d8c037d2da12288d191c6b995ca5c6 100644 (file)
@@ -334,13 +334,6 @@ cryptodev_vhost_user_get_chardev(Object *obj, Error **errp)
     return NULL;
 }
 
-static void cryptodev_vhost_user_instance_int(Object *obj)
-{
-    object_property_add_str(obj, "chardev",
-                            cryptodev_vhost_user_get_chardev,
-                            cryptodev_vhost_user_set_chardev);
-}
-
 static void cryptodev_vhost_user_finalize(Object *obj)
 {
     CryptoDevBackendVhostUser *s =
@@ -361,13 +354,17 @@ cryptodev_vhost_user_class_init(ObjectClass *oc, void *data)
     bc->create_session = cryptodev_vhost_user_sym_create_session;
     bc->close_session = cryptodev_vhost_user_sym_close_session;
     bc->do_sym_op = NULL;
+
+    object_class_property_add_str(oc, "chardev",
+                                  cryptodev_vhost_user_get_chardev,
+                                  cryptodev_vhost_user_set_chardev);
+
 }
 
 static const TypeInfo cryptodev_vhost_user_info = {
     .name = TYPE_CRYPTODEV_BACKEND_VHOST_USER,
     .parent = TYPE_CRYPTODEV_BACKEND,
     .class_init = cryptodev_vhost_user_class_init,
-    .instance_init = cryptodev_vhost_user_instance_int,
     .instance_finalize = cryptodev_vhost_user_finalize,
     .instance_size = sizeof(CryptoDevBackendVhostUser),
 };
This page took 0.026671 seconds and 4 git commands to generate.