From: Zhao Liu <zhao1.liu@intel.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
"Daniel P. Berrange" <berrange@redhat.com>,
Eduardo Habkost <eduardo@habkost.net>,
qemu-devel@nongnu.org
Subject: Re: [Question] What is the definition of “private” fields in QOM?
Date: Mon, 21 Oct 2024 22:22:35 +0800 [thread overview]
Message-ID: <ZxZjqypRL7d2rMuQ@intel.com> (raw)
In-Reply-To: <CAFEAcA8m4OeDHopFxCL3MP-cmu-PO5=2+MjNBG7YCudpKdoqDA@mail.gmail.com>
Hi Peter,
On Mon, Oct 21, 2024 at 10:25:07AM +0100, Peter Maydell wrote:
> Date: Mon, 21 Oct 2024 10:25:07 +0100
> From: Peter Maydell <peter.maydell@linaro.org>
> Subject: Re: [Question] What is the definition of “private” fields in
> QOM?
>
> On Sat, 19 Oct 2024 at 16:54, Zhao Liu <zhao1.liu@intel.com> wrote:
> >
> > Hi maintainers and list,
> >
> > In the QOM structure, the class and object structs have two members:
> > parent_class and parent_obj, which are often marked as "< private >" in
> > the comment.
> >
> > I couldn’t find information on why to define ‘private’ and ‘public’,
> > even in the earliest QOM commits and the patch emails I could find.
>
> This is a rather old thing which I think was originally
> borrowed from glib's commenting convention.
>
> I'm fairly sure that we decided a while back that they were entirely
> unnecessary, so you don't need to add them in new code. (I can't
> actually find anything with a quick list search about that though
> so maybe I'm misremembering.)
Thanks for your explanation! So I understand that directly accessing
parent_obj/parent_class is actually allowed.
> Either way, there's still a lot of them floating around in the codebase
> that were added before we made that decision.
Yes, then I understand that <private> and <public> are historical
burdens that can also be cleaned up.
Thanks,
Zhao
next prev parent reply other threads:[~2024-10-21 14:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-19 16:10 [Question] What is the definition of “private” fields in QOM? Zhao Liu
2024-10-21 8:35 ` Daniel P. Berrangé
2024-10-21 9:22 ` Zhao Liu
2024-10-21 9:25 ` Peter Maydell
2024-10-21 14:22 ` Zhao Liu [this message]
2024-10-21 14:20 ` Peter Maydell
2024-10-21 15:18 ` Zhao Liu
2024-10-21 15:06 ` Peter Maydell
2024-10-21 15:41 ` Zhao Liu
2024-10-21 16:47 ` Peter Maydell
2024-10-22 3:08 ` Junjie Mao
2024-10-22 8:42 ` Peter Maydell
2024-10-22 15:09 ` Zhao Liu
2024-10-22 15:01 ` Zhao Liu
2024-10-21 18:46 ` BALATON Zoltan
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=ZxZjqypRL7d2rMuQ@intel.com \
--to=zhao1.liu@intel.com \
--cc=berrange@redhat.com \
--cc=eduardo@habkost.net \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@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.