On Tue, Sep 22, 2020 at 2:13 AM Eduardo Habkost <ehabk...@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 <ehabk...@redhat.com> > Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> --- > Cc: "Michael S. Tsirkin" <m...@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 > > > -- Marc-André Lureau