From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Peter Crosthwaite" <peter.crosthwaite@xilinx.com>,
"Hu Tao" <hutao@cn.fujitsu.com>,
"Anthony Liguori" <anthony@codemonkey.ws>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH qom-next for-1.6 00/11] sysbus: QOM cast cleanups -- plus outlook
Date: Sat, 27 Jul 2013 22:19:45 +0200 [thread overview]
Message-ID: <1374956396-25586-1-git-send-email-afaerber@suse.de> (raw)
Hello,
This series finally eliminates the FROM_SYSBUS() macro.
It goes on to fix remaining ->qdev field accesses (less work than I thought).
I've been pushing out device patches ASAP to give them maximum review hours,
now here follows the rationale why I made this effort:
i) Murphy's Law
When there's two ways to write a device and one is considered obsolete,
someone at some point will apply a new device using FROM_SYSBUS().
ii) Broken Window theory
If we let devices languish in an obsolete state, then someone will refuse to
update their device patch, pointing that it is no worse than in-tree devices.
(Ignoring that it makes it even more work for others to convert, who don't
know the code and how to best name the new macros.)
iii) Why for-1.6?
Once the Hard Freeze is lifted, traditionally we will see submaintainers
quickly flushing their queues, with arm-devs.next, ppc-next and others
potentially adding devices using FROM_SYSBUS() or other deprecated constructs.
Applying these cleanups for v1.6-rc0 will lead to build failures for most
obsolete constructs and thereby more fairly distributing the work of rebasing
and/or bouncing patches among submaintainers.
Experience shows that posting such touch-all series to the list and waiting
for weeks does not give each device/target test coverage by reviewers;
having it in qemu.git and -rcX will more likely uncover bugs through testing.
In most cases only initialization and reset will be affected, so we should see
failures immediately. Fixing bugs should be trivial, and I am around to do so.
Bleading-edge version tree available for testing here:
git://github.com/afaerber/qemu-cpu.git qom-devices
https://github.com/afaerber/qemu-cpu/commits/qom-devices
iv) What's up next?
Many preceding SysBusDevice conversion patches grew a DeviceState *dev variable
to prepare for conversion to QOM realize: dev variable and sbd argument will
simply switch place, avoiding variable renaming along with functional changes.
Loved by some, loathed by others, SysBusDevices are the simplest because
no initialization/unintialization really happens at bus level (there is no bus).
PCIDevice and others with multiple levels of initfn are waiting on proposals
under discussion of how to efficiently call the parent's method implementation.
I plan to submit a RFC inspired by Peter C.'s work for ISA/CPU/virtio.
Implementing QOM CPU topologies for x86, s390x and arm SoCs requires recursive
realization - offloading that to QOM infrastructure won't make it into 1.6.
So all devices being worked on still need to manually realize their children
where they qdev_init()ed them before, violating the same ordering constraints
Paolo brought up for the infrastructure-based approach. Feedback appreciated.
Embedding busses still faces challenges wrt device ID and VMState to be solved.
Peter M. has an RFC for how to allow embedding structs while shielding fields.
A script to inspect the QOM tree similar to qtree may come increasingly handy
the more we think about devices not on a bus or actually using the composition
model we've been building up for ACPI or qtests.
qtests will come very handy the more devices we touch. Having each machine
covered by some test would be a start, having each non-default device covered
even better, and be it no-op to exercise instantiation, hot-add/remove a bonus.
Probably many other QOM TODOs not on my mind right now. :-)
Regards,
Andreas
Cc: Anthony Liguori <anthony@codemonkey.ws>
Cc: Hu Tao <hutao@cn.fujitsu.com>
Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Andreas Färber (11):
sysbus: Drop FROM_SYSBUS()
sysbus: Remove unused sysbus_new() prototype
exynos4210_i2c: QOM cast cleanup
opencores_eth: QOM cast cleanup
mipsnet: QOM cast cleanup
kvmvapic: QOM cast cleanup
kvm/ioapic: QOM cast cleanup
ioapic: QOM cast cleanup
mips_malta: QOM cast cleanup
spapr_pci: QOM cast cleanup
sysbus: QOM parent field cleanup for SysBusDevice
hw/i2c/exynos4210_i2c.c | 12 +++++++-----
hw/i386/kvm/ioapic.c | 4 ++--
hw/i386/kvmvapic.c | 4 ++--
hw/intc/ioapic.c | 2 +-
hw/mips/mips_malta.c | 12 ++++++++----
hw/net/mipsnet.c | 20 ++++++++++++--------
hw/net/opencores_eth.c | 24 +++++++++++++++---------
hw/ppc/spapr_pci.c | 7 ++++---
include/hw/sysbus.h | 9 ++++-----
9 files changed, 55 insertions(+), 39 deletions(-)
--
1.8.1.4
next reply other threads:[~2013-07-27 20:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-27 20:19 Andreas Färber [this message]
2013-07-27 20:19 ` [Qemu-devel] [PATCH qom-next for-1.6 01/11] sysbus: Drop FROM_SYSBUS() Andreas Färber
2013-07-27 20:19 ` [Qemu-devel] [PATCH qom-next for-1.6 02/11] sysbus: Remove unused sysbus_new() prototype Andreas Färber
2013-07-27 20:19 ` [Qemu-devel] [PATCH qom-next for-1.6 03/11] exynos4210_i2c: QOM cast cleanup Andreas Färber
2013-07-27 20:19 ` [Qemu-devel] [PATCH qom-next for-1.6 04/11] opencores_eth: " Andreas Färber
2013-07-27 20:19 ` [Qemu-devel] [PATCH qom-next for-1.6 05/11] mipsnet: " Andreas Färber
2013-07-27 20:19 ` [Qemu-devel] [PATCH qom-next for-1.6 06/11] kvmvapic: " Andreas Färber
2013-07-27 20:19 ` [Qemu-devel] [PATCH qom-next for-1.6 07/11] kvm/ioapic: " Andreas Färber
2013-07-27 20:19 ` [Qemu-devel] [PATCH qom-next for-1.6 08/11] ioapic: " Andreas Färber
2013-07-27 20:19 ` [Qemu-devel] [PATCH qom-next for-1.6 09/11] mips_malta: " Andreas Färber
2013-07-27 20:19 ` [Qemu-devel] [PATCH qom-next for-1.6 10/11] spapr_pci: " Andreas Färber
2013-07-27 20:19 ` [Qemu-devel] [PATCH qom-next for-1.6 11/11] sysbus: QOM parent field cleanup for SysBusDevice Andreas Färber
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=1374956396-25586-1-git-send-email-afaerber@suse.de \
--to=afaerber@suse.de \
--cc=anthony@codemonkey.ws \
--cc=hutao@cn.fujitsu.com \
--cc=pbonzini@redhat.com \
--cc=peter.crosthwaite@xilinx.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 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).