From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3BS1-0003Ts-Jr for qemu-devel@nongnu.org; Sat, 27 Jul 2013 16:50:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3BGE-0004Dz-NY for qemu-devel@nongnu.org; Sat, 27 Jul 2013 16:38:47 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44083 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3AyC-0008F1-OM for qemu-devel@nongnu.org; Sat, 27 Jul 2013 16:20:04 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sat, 27 Jul 2013 22:19:45 +0200 Message-Id: <1374956396-25586-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH qom-next for-1.6 00/11] sysbus: QOM cast cleanups -- plus outlook List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Peter Crosthwaite , Hu Tao , Anthony Liguori , Paolo Bonzini , =?UTF-8?q?Andreas=20F=C3=A4rber?= Hello, This series finally eliminates the FROM_SYSBUS() macro. It goes on to fix remaining ->qdev field accesses (less work than I thoug= ht). I've been pushing out device patches ASAP to give them maximum review hou= rs, 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 devi= ces. (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 constr= ucts. Applying these cleanups for v1.6-rc0 will lead to build failures for most obsolete constructs and thereby more fairly distributing the work of reba= sing and/or bouncing patches among submaintainers. Experience shows that posting such touch-all series to the list and waiti= ng 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 test= ing. In most cases only initialization and reset will be affected, so we shoul= d see failures immediately. Fixing bugs should be trivial, and I am around to d= o 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 va= riable to prepare for conversion to QOM realize: dev variable and sbd argument w= ill simply switch place, avoiding variable renaming along with functional cha= nges. Loved by some, loathed by others, SysBusDevices are the simplest because no initialization/unintialization really happens at bus level (there is n= o bus). PCIDevice and others with multiple levels of initfn are waiting on propos= als under discussion of how to efficiently call the parent's method implement= ation. 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 recu= rsive 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 child= ren where they qdev_init()ed them before, violating the same ordering constra= ints Paolo brought up for the infrastructure-based approach. Feedback apprecia= ted. Embedding busses still faces challenges wrt device ID and VMState to be s= olved. Peter M. has an RFC for how to allow embedding structs while shielding fi= elds. A script to inspect the QOM tree similar to qtree may come increasingly h= andy the more we think about devices not on a bus or actually using the compos= ition model we've been building up for ACPI or qtests. qtests will come very handy the more devices we touch. Having each machin= e covered by some test would be a start, having each non-default device cov= ered 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 Cc: Hu Tao Cc: Peter Crosthwaite Cc: Paolo Bonzini Cc: Peter Maydell Andreas F=C3=A4rber (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(-) --=20 1.8.1.4