From c734cd40a10943753a4d015c9d0a6c08c8f0159e Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Wed, 16 Sep 2020 14:25:16 -0400 Subject: qom: Remove ParentClassType argument from OBJECT_DECLARE_SIMPLE_TYPE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The requirement to specify the parent class type makes the macro harder to use and easy to misuse (silent bugs can be introduced if the wrong struct type is specified). Simplify the macro by just not declaring any class struct, allowing us to remove the class_size field from the TypeInfo variables for those types. Signed-off-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200916182519.415636-3-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- backends/dbus-vmstate.c | 3 +-- backends/vhost-user.c | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'backends') diff --git a/backends/dbus-vmstate.c b/backends/dbus-vmstate.c index a13461e..5bffbc4 100644 --- a/backends/dbus-vmstate.c +++ b/backends/dbus-vmstate.c @@ -24,7 +24,7 @@ #define TYPE_DBUS_VMSTATE "dbus-vmstate" OBJECT_DECLARE_SIMPLE_TYPE(DBusVMState, dbus_vmstate, - DBUS_VMSTATE, ObjectClass) + DBUS_VMSTATE) struct DBusVMState { @@ -483,7 +483,6 @@ static const TypeInfo dbus_vmstate_info = { .parent = TYPE_OBJECT, .instance_size = sizeof(DBusVMState), .instance_finalize = dbus_vmstate_finalize, - .class_size = sizeof(DBusVMStateClass), .class_init = dbus_vmstate_class_init, .interfaces = (InterfaceInfo[]) { { TYPE_USER_CREATABLE }, diff --git a/backends/vhost-user.c b/backends/vhost-user.c index 9e6e198..ae8362d 100644 --- a/backends/vhost-user.c +++ b/backends/vhost-user.c @@ -197,7 +197,6 @@ static const TypeInfo vhost_user_backend_info = { .instance_size = sizeof(VhostUserBackend), .instance_init = vhost_user_backend_init, .instance_finalize = vhost_user_backend_finalize, - .class_size = sizeof(VhostUserBackendClass), }; static void register_types(void) -- cgit v1.1