From: Zhao Liu <zhao1.liu@intel.com>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P . Berrang�" <berrange@redhat.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
qemu-devel@nongnu.org, qemu-trivial@nongnu.org
Subject: Re: [PATCH 1/9] qom/object: Improve the doc of macros related with simple type
Date: Wed, 14 May 2025 23:32:17 +0800 [thread overview]
Message-ID: <aCS3gS3+qdxZof75@intel.com> (raw)
In-Reply-To: <e213c4bf-1b26-f1c3-c3ed-10c2adff4a5d@eik.bme.hu>
Hi BALATON,
On Wed, May 14, 2025 at 02:02:48PM +0200, BALATON Zoltan wrote:
> Date: Wed, 14 May 2025 14:02:48 +0200
> From: BALATON Zoltan <balaton@eik.bme.hu>
> Subject: Re: [PATCH 1/9] qom/object: Improve the doc of macros related with
> simple type
>
> On Wed, 14 May 2025, Zhao Liu wrote:
> > There're 2 changes:
> > - For OBJECT_DECLARE_SIMPLE_TYPE:
> >
> > Since a clase may not only has virtual method, but also field, thus
>
> class may not only have virtual methods but also fields, clarify when class
> is not needed
Thanks for the polish! It sounds better.
> > mention when class is not needed for either, then there is no need
> > to have the class.
> >
> > - For OBJECT_DEFINE_SIMPLE_TYPE_WITH_INTERFACES:
> >
> > And the words like OBJECT_DEFINE_SIMPLE_TYPE about when the type is
> > declared by OBJECT_DECLARE_SIMPLE_TYPE, then user should consider
> > to define the type via OBJECT_DEFINE_SIMPLE_TYPE or
> > OBJECT_DEFINE_SIMPLE_TYPE_WITH_INTERFACES.
> >
> > Cc: Paolo Bonzini <pbonzini@redhat.com>
> > Cc: "Daniel P. Berrang?" <berrange@redhat.com>
> > Cc: Eduardo Habkost <eduardo@habkost.net>
> > Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
> > ---
> > include/qom/object.h | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/qom/object.h b/include/qom/object.h
> > index 1d5b03372429..14f84ae454d3 100644
> > --- a/include/qom/object.h
> > +++ b/include/qom/object.h
> > @@ -249,7 +249,7 @@ struct Object
> > * declared.
> > *
> > * This macro should be used unless the class struct needs to have
> > - * virtual methods declared.
> > + * virtual methods or fields declared.
> > */
> > #define OBJECT_DECLARE_SIMPLE_TYPE(InstanceType, MODULE_OBJ_NAME) \
> > typedef struct InstanceType InstanceType; \
> > @@ -402,7 +402,8 @@ struct Object
> > *
> > * This is a variant of OBJECT_DEFINE_TYPE_EXTENDED, which is suitable for
> > * the case of a non-abstract type, with interfaces, and with no requirement
> > - * for a class struct.
> > + * for a class struct. If you declared your type with OBJECT_DECLARE_SIMPLE_TYPE
> > + * then this is probably the right choice for defining it.
>
> Is "probably" correct here? Is it a must or can still use other defining
> macros?
Yes, because there's another choice: OBJECT_DEFINE_SIMPLE_TYPE.
> If correct maybe saying "this might be the right choice" is simpler.
:-) I copied this sentence from the documentation of
OBJECT_DEFINE_SIMPLE_TYPE. The difference between these 2 macros is
OBJECT_DEFINE_SIMPLE_TYPE doesn't support interface.
So I'd like to keep this sentence, consistent with the description of
OBJECT_DEFINE_SIMPLE_TYPE.
Thanks,
Zhao
next prev parent reply other threads:[~2025-05-14 15:12 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 [this message]
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 ` [PATCH 6/9] hw/ppc/pef: " Zhao Liu
2025-05-14 11:46 ` 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=aCS3gS3+qdxZof75@intel.com \
--to=zhao1.liu@intel.com \
--cc=balaton@eik.bme.hu \
--cc=berrange@redhat.com \
--cc=eduardo@habkost.net \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.