From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Alexander Graf" <agraf@suse.de>,
"Anthony Liguori" <aliguori@us.ibm.com>,
"Andreas Färber" <afaerber@suse.de>,
patches@linaro.org
Subject: [Qemu-devel] [RFC 0/2] Allow QOM struct fields to be marked as private
Date: Thu, 25 Jul 2013 17:42:01 +0100 [thread overview]
Message-ID: <1374770523-6570-1-git-send-email-peter.maydell@linaro.org> (raw)
This patch series provides infrastructure and documentation
for marking QOM struct fields as private to the class implementation.
Patch 1 is the implementation (which is a trivial five lines!) and
documentation of the code pattern that it's intended to be used with.
Patch 2 is an example of its use in the ARM GIC classes. This
patch depends on Andreas' "A9MPCore+A15MPCore QOM'ification" v2
patchset, really just because there aren't any examples in the
tree at the moment of devices which I understand and which use the
"include file with device struct which is included by both
implementation and object users" pattern.
A .h file which uses this pattern ends up with half a dozen
extra lines of boilerplate, which is slightly sad but not too
awful. It would be pretty easy to autogenerate (along with the
type macros themselves) if we decided to do that in future, though.
I'm not hugely attached to either the "__private" or IMPLEMENTING_FOO
naming conventions, so feel free to bikeshed them. (I am aware that
the former is treading on the implementation reserved namespace...)
Incidentally, I think I would be in favour of (as a coding style
issue) having exactly one class per .h file, which the gic doesn't
currently do (it puts both TYPE_ARM_GIC_COMMON and TYPE_ARM_GIC in
one file).
Peter Maydell (2):
Provide infrastructure for marking private QOM struct fields
arm_gic: Use new __private macro to mark private fields
hw/intc/arm_gic.c | 3 +++
hw/intc/arm_gic_common.c | 2 ++
hw/intc/arm_gic_kvm.c | 2 ++
hw/intc/armv7m_nvic.c | 2 ++
include/hw/intc/arm_gic.h | 64 ++++++++++++++++++++++++++++-----------------
include/qemu/compiler.h | 10 +++++++
include/qom/object.h | 47 +++++++++++++++++++++++++++++++++
7 files changed, 106 insertions(+), 24 deletions(-)
--
1.7.9.5
next reply other threads:[~2013-07-25 16:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-25 16:42 Peter Maydell [this message]
2013-07-25 16:42 ` [Qemu-devel] [RFC 1/2] Provide infrastructure for marking private QOM struct fields Peter Maydell
2013-07-26 4:39 ` Edgar E. Iglesias
2013-07-25 16:42 ` [Qemu-devel] [RFC 2/2] arm_gic: Use new __private macro to mark private fields Peter Maydell
2013-07-25 19:04 ` Alexander Graf
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=1374770523-6570-1-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=aliguori@us.ibm.com \
--cc=patches@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 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).