On 14.05.25 10:49, Zhao Liu wrote:
The QOM type of S390PVGuest is declared by OBJECT_DECLARE_SIMPLE_TYPE,
which means it doesn't need the class!

Therefore, use OBJECT_DEFINE_SIMPLE_TYPE_WITH_INTERFACES to implement
the type, then there's no need for class definition.

Cc: Halil Pasic <pa...@linux.ibm.com>
Cc: Christian Borntraeger <borntrae...@linux.ibm.com>
Cc: Thomas Huth <th...@redhat.com>
Cc: Richard Henderson <richard.hender...@linaro.org>
Cc: David Hildenbrand <da...@redhat.com>
Cc: Ilya Leoshkevich <i...@linux.ibm.com>
Cc: qemu-s3...@nongnu.org
Signed-off-by: Zhao Liu <zhao1....@intel.com>
---
  target/s390x/kvm/pv.c | 18 ++++++------------
  1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/target/s390x/kvm/pv.c b/target/s390x/kvm/pv.c
index 2bc916a5455f..a4dbbcef7e08 100644
--- a/target/s390x/kvm/pv.c
+++ b/target/s390x/kvm/pv.c
@@ -313,12 +313,6 @@ struct S390PVGuest {
      ConfidentialGuestSupport parent_obj;
  };
-typedef struct S390PVGuestClass S390PVGuestClass;
-
-struct S390PVGuestClass {
-    ConfidentialGuestSupportClass parent_class;
-};
-
  /*
   * If protected virtualization is enabled, the amount of data that the
   * Read SCP Info Service Call can use is limited to one page. The
@@ -380,12 +374,12 @@ static int s390_pv_kvm_init(ConfidentialGuestSupport 
*cgs, Error **errp)
      return 0;
  }
-OBJECT_DEFINE_TYPE_WITH_INTERFACES(S390PVGuest,
-                                   s390_pv_guest,
-                                   S390_PV_GUEST,
-                                   CONFIDENTIAL_GUEST_SUPPORT,
-                                   { TYPE_USER_CREATABLE },
-                                   { NULL })
+OBJECT_DEFINE_SIMPLE_TYPE_WITH_INTERFACES(S390PVGuest,
+                                          s390_pv_guest,
+                                          S390_PV_GUEST,
+                                          CONFIDENTIAL_GUEST_SUPPORT,
+                                          { TYPE_USER_CREATABLE },
+                                          { NULL })

I'll note that existing callers of OBJECT_DEFINE_SIMPLE_TYPE_WITH_INTERFACES happily ignore the line limit and put it into a single line.

(which ends up looking better IMHO)

Reviewed-by: David Hildenbrand <da...@redhat.com>

--
Cheers,

David / dhildenb


Reply via email to