qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 05/24] vhost-user: Register "chardev" as class property


From: Igor Mammedov
Subject: Re: [PATCH 05/24] vhost-user: Register "chardev" as class property
Date: Fri, 23 Oct 2020 20:16:55 +0200

On Mon, 21 Sep 2020 18:10:26 -0400
Eduardo Habkost <ehabkost@redhat.com> 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: Igor Mammedov <imammedo@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),
>  };




reply via email to

[Prev in Thread] Current Thread [Next in Thread]