qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/4] Allow QOM struct fields to be marked as private
@ 2014-05-09 15:56 Peter Maydell
  2014-05-09 15:56 ` [Qemu-devel] [PATCH v2 1/4] Provide infrastructure for marking private QOM struct fields Peter Maydell
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Peter Maydell @ 2014-05-09 15:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: Andreas Färber, Anthony Liguori, patches

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.

Patches 2, 3 and 4 are examples of its use: patch 2 deals with
the ARM GIC classes, as an example of a largish class with some
subclasses. Patches 3 and 4 are conversions of much simpler and
smaller devices, so might be easier to look at first.

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.

Example of the compiler message if you try to touch a field
which is private:
 arm_gic_kvm.c:559:5: error: ‘iomem’ is deprecated (declared at /root/qemu/include/hw/intc/arm_gic_common.h:105): this field is private [-Werror=deprecated-declarations]


Changes since the RFC back in July last year:
 * name the macro 'qom_private' rather than '__private'
 * redid patch 2 as the GIC code has been rearranged somewhat
 * patches 3 and 4 are new

Peter Maydell (4):
  Provide infrastructure for marking private QOM struct fields
  arm_gic: Use new qom_private macro to mark private fields
  a9scu: Use qom_private to mark private fields
  arm11scu: Use qom_private 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 ++
 hw/misc/a9scu.c                  |  2 ++
 hw/misc/arm11scu.c               |  2 ++
 include/hw/intc/arm_gic.h        | 12 ++++++--
 include/hw/intc/arm_gic_common.h | 62 +++++++++++++++++++++++-----------------
 include/hw/misc/a9scu.h          | 16 +++++++----
 include/hw/misc/arm11scu.h       | 14 ++++++---
 include/qemu/compiler.h          | 10 +++++++
 include/qom/object.h             | 47 ++++++++++++++++++++++++++++++
 12 files changed, 136 insertions(+), 38 deletions(-)

-- 
1.9.2

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-05-23 17:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-09 15:56 [Qemu-devel] [PATCH v2 0/4] Allow QOM struct fields to be marked as private Peter Maydell
2014-05-09 15:56 ` [Qemu-devel] [PATCH v2 1/4] Provide infrastructure for marking private QOM struct fields Peter Maydell
2014-05-09 15:56 ` [Qemu-devel] [PATCH v2 2/4] arm_gic: Use new qom_private macro to mark private fields Peter Maydell
2014-05-09 15:56 ` [Qemu-devel] [PATCH v2 3/4] a9scu: Use qom_private " Peter Maydell
2014-05-09 15:56 ` [Qemu-devel] [PATCH v2 4/4] arm11scu: " Peter Maydell
2014-05-23 11:13 ` [Qemu-devel] [PATCH v2 0/4] Allow QOM struct fields to be marked as private Peter Maydell
2014-05-23 11:23   ` Andreas Färber
2014-05-23 11:50     ` Peter Maydell
2014-05-23 14:33       ` Paolo Bonzini
2014-05-23 16:21         ` Peter Maydell
2014-05-23 17:13           ` Paolo Bonzini

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).