From: Zhao Liu <zhao1.liu@intel.com>
To: "Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P . Berrangé" <berrange@redhat.com>,
"Eduardo Habkost" <eduardo@habkost.net>
Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org,
Zhao Liu <zhao1.liu@intel.com>,
Nicholas Piggin <npiggin@gmail.com>,
Daniel Henrique Barboza <danielhb413@gmail.com>,
Harsh Prateek Bora <harshpb@linux.ibm.com>,
qemu-ppc@nongnu.org
Subject: [PATCH 6/9] hw/ppc/pef: Consolidate OBJECT_DEFINE_SIMPLE_TYPE_WITH_INTERFACES
Date: Wed, 14 May 2025 16:49:54 +0800 [thread overview]
Message-ID: <20250514084957.2221975-7-zhao1.liu@intel.com> (raw)
In-Reply-To: <20250514084957.2221975-1-zhao1.liu@intel.com>
The QOM type of PefGuest 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: Nicholas Piggin <npiggin@gmail.com>
Cc: Daniel Henrique Barboza <danielhb413@gmail.com>
Cc: Harsh Prateek Bora <harshpb@linux.ibm.com>
Cc: qemu-ppc@nongnu.org
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
hw/ppc/pef.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/hw/ppc/pef.c b/hw/ppc/pef.c
index 254f5707876f..1832791ee533 100644
--- a/hw/ppc/pef.c
+++ b/hw/ppc/pef.c
@@ -20,11 +20,6 @@
OBJECT_DECLARE_SIMPLE_TYPE(PefGuest, PEF_GUEST)
typedef struct PefGuest PefGuest;
-typedef struct PefGuestClass PefGuestClass;
-
-struct PefGuestClass {
- ConfidentialGuestSupportClass parent_class;
-};
/**
* PefGuest:
@@ -121,12 +116,12 @@ static int pef_kvm_reset(ConfidentialGuestSupport *cgs, Error **errp)
return kvmppc_svm_off(errp);
}
-OBJECT_DEFINE_TYPE_WITH_INTERFACES(PefGuest,
- pef_guest,
- PEF_GUEST,
- CONFIDENTIAL_GUEST_SUPPORT,
- { TYPE_USER_CREATABLE },
- { NULL })
+OBJECT_DEFINE_SIMPLE_TYPE_WITH_INTERFACES(PefGuest,
+ pef_guest,
+ PEF_GUEST,
+ CONFIDENTIAL_GUEST_SUPPORT,
+ { TYPE_USER_CREATABLE },
+ { NULL })
static void pef_guest_class_init(ObjectClass *oc, const void *data)
{
--
2.34.1
next prev parent reply other threads:[~2025-05-14 8:31 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-14 8:49 [PATCH 0/9] qom: Consolidate OBJECT_{DEFINE|DECLARE}_SIMPLE_TYPE* Zhao Liu
2025-05-14 8:49 ` [PATCH 1/9] qom/object: Improve the doc of macros related with simple type Zhao Liu
2025-05-14 12:02 ` BALATON Zoltan
2025-05-14 15:32 ` Zhao Liu
2025-05-14 16:13 ` BALATON Zoltan
2025-05-15 14:01 ` Zhao Liu
2025-05-14 8:49 ` [PATCH 2/9] docs/devel/qom: Fix the doc about OBJECT_DECLARE_SIMPLE_TYPE Zhao Liu
2025-05-14 12:06 ` BALATON Zoltan
2025-05-14 15:45 ` Zhao Liu
2025-05-14 16:16 ` BALATON Zoltan
2025-05-15 14:04 ` Zhao Liu
2025-05-14 8:49 ` [PATCH 3/9] hw/acpi/pci: Consolidate OBJECT_DEFINE_SIMPLE_TYPE_WITH_INTERFACES Zhao Liu
2025-05-14 13:08 ` Ani Sinha
2025-05-14 8:49 ` [PATCH 4/9] hw/char/sh_serial: " Zhao Liu
2025-05-14 12:07 ` BALATON Zoltan
2025-05-14 15:46 ` Zhao Liu
2025-05-14 8:49 ` [PATCH 5/9] hw/hyperv/hv-balloon: " Zhao Liu
2025-05-19 14:10 ` Maciej S. Szmigiero
2025-05-14 8:49 ` Zhao Liu [this message]
2025-05-14 11:46 ` [PATCH 6/9] hw/ppc/pef: " BALATON Zoltan
2025-05-14 11:59 ` BALATON Zoltan
2025-05-14 8:49 ` [PATCH 7/9] hw/core/resetcontainer: Consolidate OBJECT_DECLARE_SIMPLE_TYPE Zhao Liu
2025-05-14 16:56 ` Philippe Mathieu-Daudé
2025-05-14 8:49 ` [PATCH 8/9] target/s390x/kvm/pv: Consolidate OBJECT_DEFINE_SIMPLE_TYPE_WITH_INTERFACES Zhao Liu
2025-05-14 8:51 ` David Hildenbrand
2025-05-14 15:53 ` Zhao Liu
2025-05-14 16:24 ` BALATON Zoltan
2025-05-15 13:50 ` Zhao Liu
2025-05-15 15:41 ` BALATON Zoltan
2025-05-15 16:11 ` Daniel P. Berrangé
2025-05-16 3:23 ` Zhao Liu
2025-05-16 7:47 ` David Hildenbrand
2025-05-14 8:49 ` [PATCH 9/9] ui/console-vc: Consolidate OBJECT_DEFINE_SIMPLE_TYPE Zhao Liu
2025-05-14 16:55 ` Philippe Mathieu-Daudé
2025-05-31 17:36 ` [PATCH 0/9] qom: Consolidate OBJECT_{DEFINE|DECLARE}_SIMPLE_TYPE* Michael Tokarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250514084957.2221975-7-zhao1.liu@intel.com \
--to=zhao1.liu@intel.com \
--cc=berrange@redhat.com \
--cc=danielhb413@gmail.com \
--cc=eduardo@habkost.net \
--cc=harshpb@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).