[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 05/24] vhost-user: Register "chardev" as class property
From: |
Michael S. Tsirkin |
Subject: |
Re: [PATCH 05/24] vhost-user: Register "chardev" as class property |
Date: |
Fri, 30 Oct 2020 04:56:43 -0400 |
On Mon, Sep 21, 2020 at 06:10:26PM -0400, Eduardo Habkost wrote:
> 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: Michael S. Tsirkin <mst@redhat.com>
> ---
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: qemu-devel@nongnu.org
> ---
> backends/vhost-user.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/backends/vhost-user.c b/backends/vhost-user.c
> index 9e6e1985465..858fdeae26c 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,
> .class_size = sizeof(VhostUserBackendClass),
> };
> --
> 2.26.2