[PATCH v3 00/39] qdev: Rework how we plug into the parent bus

Markus Armbruster posted 39 patches 3 years, 10 months ago
Test docker-mingw@fedora passed
Test checkpatch passed
Test asan passed
Test docker-quick@centos7 passed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200609163932.1566209-1-armbru@redhat.com
Maintainers: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Leif Lindholm <leif@nuviainc.com>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Juan Quintela <quintela@redhat.com>, Peter Chubb <peter.chubb@nicta.com.au>, "Hervé Poussineau" <hpoussin@reactos.org>, Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>, Samuel Thibault <samuel.thibault@ens-lyon.org>, Max Reitz <mreitz@redhat.com>, Helge Deller <deller@gmx.de>, Aurelien Jarno <aurelien@aurel32.net>, "Cédric Le Goater" <clg@kaod.org>, Thomas Huth <huth@tuxfamily.org>, Andrew Jeffery <andrew@aj.id.au>, Stafford Horne <shorne@gmail.com>, Magnus Damm <magnus.damm@gmail.com>, Chris Wulff <crwulff@gmail.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Max Filippov <jcmvbkbc@gmail.com>, Halil Pasic <pasic@linux.ibm.com>, Jason Wang <jasowang@redhat.com>, John Snow <jsnow@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Artyom Tarasenko <atar4qemu@gmail.com>, BALATON Zoltan <balaton@eik.bme.hu>, Rob Herring <robh@kernel.org>, Peter Maydell <peter.maydell@linaro.org>, Cornelia Huck <cohuck@redhat.com>, Fabien Chouteau <chouteau@adacore.com>, Subbaraya Sundeep <sundeep.lkml@gmail.com>, Gerd Hoffmann <kraxel@redhat.com>, David Gibson <david@gibson.dropbear.id.au>, Matthew Rosato <mjrosato@linux.ibm.com>, Beniamino Galvani <b.galvani@gmail.com>, Sagar Karandikar <sagark@eecs.berkeley.edu>, "Daniel P. Berrangé" <berrange@redhat.com>, Huacai Chen <chenhc@lemote.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Jan Kiszka <jan.kiszka@web.de>, Igor Mammedov <imammedo@redhat.com>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Tony Krowiak <akrowiak@linux.ibm.com>, Stefano Stabellini <sstabellini@kernel.org>, Christian Borntraeger <borntraeger@de.ibm.com>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Jia Liu <proljc@gmail.com>, Laurent Vivier <laurent@vivier.eu>, KONRAD Frederic <frederic.konrad@adacore.com>, Paul Durrant <paul@xen.org>, Jean-Christophe Dubois <jcd@tribudubois.net>, Igor Mitsyanko <i.mitsyanko@gmail.com>, Fam Zheng <fam@euphon.net>, Andrew Baumann <Andrew.Baumann@microsoft.com>, Paul Burton <pburton@wavecomp.com>, Anthony Perard <anthony.perard@citrix.com>, Alistair Francis <alistair@alistair23.me>, Palmer Dabbelt <palmer@dabbelt.com>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Corey Minyard <cminyard@mvista.com>, Marek Vasut <marex@denx.de>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Richard Henderson <rth@twiddle.net>, Michael Walle <michael@walle.cc>, Antony Pavlov <antonynpavlov@gmail.com>, Andrey Smirnov <andrew.smirnov@gmail.com>, Eduardo Habkost <ehabkost@redhat.com>, Andrzej Zaborowski <balrogg@gmail.com>, Pierre Morel <pmorel@linux.ibm.com>, Joel Stanley <joel@jms.id.au>, Laszlo Ersek <lersek@redhat.com>, Radoslaw Biernacki <radoslaw.biernacki@linaro.org>, Kevin Wolf <kwolf@redhat.com>, Niek Linnenbank <nieklinnenbank@gmail.com>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, Thomas Huth <thuth@redhat.com>, David Hildenbrand <david@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
There is a newer version of this series
hw/lm32/lm32.h                           |  13 ++-
hw/lm32/milkymist-hw.h                   |  37 ++++---
include/hw/audio/pcspk.h                 |   5 +-
include/hw/char/cadence_uart.h           |   5 +-
include/hw/char/cmsdk-apb-uart.h         |   4 +-
include/hw/char/pl011.h                  |   9 +-
include/hw/char/xilinx_uartlite.h        |   4 +-
include/hw/cris/etraxfs.h                |   4 +-
include/hw/isa/isa.h                     |   5 +-
include/hw/misc/auxbus.h                 |  18 +--
include/hw/misc/unimp.h                  |   5 +-
include/hw/net/ne2000-isa.h              |   5 +-
include/hw/pci/pci.h                     |   6 +-
include/hw/qdev-core.h                   |  12 +-
include/hw/ssi/ssi.h                     |   5 -
include/hw/timer/cmsdk-apb-timer.h       |   4 +-
include/hw/timer/i8254.h                 |   9 +-
include/hw/usb.h                         |   6 +-
include/qom/object.h                     |  30 ++++-
hw/acpi/pcihp.c                          |   2 +-
hw/acpi/piix4.c                          |   6 +-
hw/alpha/typhoon.c                       |   4 +-
hw/arm/allwinner-a10.c                   |   9 +-
hw/arm/allwinner-h3.c                    |   5 +-
hw/arm/armsse.c                          |  26 ++---
hw/arm/aspeed.c                          |  15 ++-
hw/arm/aspeed_ast2600.c                  |  43 +++-----
hw/arm/aspeed_soc.c                      |  39 +++----
hw/arm/bcm2836.c                         |   3 +-
hw/arm/cubieboard.c                      |   4 +-
hw/arm/digic.c                           |   4 +-
hw/arm/exynos4210.c                      |  44 ++++----
hw/arm/exynos4_boards.c                  |   4 +-
hw/arm/fsl-imx25.c                       |   4 +-
hw/arm/fsl-imx31.c                       |   4 +-
hw/arm/fsl-imx6.c                        |   5 +-
hw/arm/fsl-imx6ul.c                      |   4 +-
hw/arm/fsl-imx7.c                        |   5 +-
hw/arm/highbank.c                        |  26 ++---
hw/arm/imx25_pdk.c                       |   8 +-
hw/arm/integratorcp.c                    |   4 +-
hw/arm/kzm.c                             |   3 +-
hw/arm/mcimx6ul-evk.c                    |   5 +-
hw/arm/mcimx7d-sabre.c                   |   5 +-
hw/arm/mps2-tz.c                         |  18 ++-
hw/arm/msf2-som.c                        |  12 +-
hw/arm/musca.c                           |  14 +--
hw/arm/musicpal.c                        |   8 +-
hw/arm/netduino2.c                       |   4 +-
hw/arm/netduinoplus2.c                   |   4 +-
hw/arm/nrf51_soc.c                       |   2 +-
hw/arm/nseries.c                         |   8 +-
hw/arm/omap1.c                           |  16 +--
hw/arm/omap2.c                           |  16 +--
hw/arm/orangepi.c                        |   4 +-
hw/arm/pxa2xx.c                          |   8 +-
hw/arm/pxa2xx_gpio.c                     |   5 +-
hw/arm/pxa2xx_pic.c                      |   5 +-
hw/arm/raspi.c                           |   8 +-
hw/arm/realview.c                        |  20 ++--
hw/arm/sabrelite.c                       |   4 +-
hw/arm/sbsa-ref.c                        |  24 ++--
hw/arm/spitz.c                           |   4 +-
hw/arm/stellaris.c                       |  12 +-
hw/arm/stm32f405_soc.c                   |   6 +-
hw/arm/strongarm.c                       |   9 +-
hw/arm/versatilepb.c                     |  16 +--
hw/arm/vexpress.c                        |  16 +--
hw/arm/virt.c                            |  36 +++---
hw/arm/xilinx_zynq.c                     |  42 +++----
hw/arm/xlnx-versal-virt.c                |   9 +-
hw/arm/xlnx-versal.c                     |   9 +-
hw/arm/xlnx-zcu102.c                     |  24 ++--
hw/arm/xlnx-zynqmp.c                     |  16 +--
hw/audio/intel-hda.c                     |   4 +-
hw/block/fdc.c                           |  16 +--
hw/block/nand.c                          |   2 +-
hw/block/pflash_cfi01.c                  |   4 +-
hw/block/pflash_cfi02.c                  |   4 +-
hw/block/xen-block.c                     |   4 +-
hw/char/exynos4210_uart.c                |   5 +-
hw/char/mcf_uart.c                       |   5 +-
hw/char/parallel-isa.c                   |   5 +-
hw/char/serial-isa.c                     |   7 +-
hw/char/serial-pci-multi.c               |   6 +-
hw/char/serial-pci.c                     |   5 +-
hw/char/serial.c                         |  10 +-
hw/char/spapr_vty.c                      |   4 +-
hw/core/bus.c                            |  23 +++-
hw/core/empty_slot.c                     |   5 +-
hw/core/qdev.c                           | 134 +++++++++++++++--------
hw/core/sysbus.c                         |   9 +-
hw/cris/axis_dev88.c                     |   4 +-
hw/display/ati.c                         |   5 +-
hw/display/milkymist-tmu2.c              |   4 +-
hw/display/sm501.c                       |   9 +-
hw/display/virtio-gpu-pci.c              |   3 +-
hw/display/virtio-vga.c                  |   3 +-
hw/display/xlnx_dp.c                     |  13 ++-
hw/dma/i8257.c                           |   9 +-
hw/dma/pxa2xx_dma.c                      |   8 +-
hw/dma/rc4030.c                          |   5 +-
hw/dma/sparc32_dma.c                     |  16 +--
hw/dma/xilinx_axidma.c                   |   9 +-
hw/hppa/dino.c                           |   4 +-
hw/hppa/lasi.c                           |   4 +-
hw/hppa/machine.c                        |   4 +-
hw/i2c/core.c                            |   5 +-
hw/i2c/smbus_eeprom.c                    |   4 +-
hw/i386/amd_iommu.c                      |   3 +-
hw/i386/pc.c                             |  12 +-
hw/i386/pc_q35.c                         |  14 +--
hw/i386/pc_sysfw.c                       |   4 +-
hw/i386/x86.c                            |   6 +-
hw/ide/isa.c                             |   5 +-
hw/ide/qdev.c                            |   4 +-
hw/intc/exynos4210_gic.c                 |   5 +-
hw/intc/i8259_common.c                   |   5 +-
hw/intc/pnv_xive.c                       |   6 +-
hw/intc/s390_flic.c                      |   6 +-
hw/intc/spapr_xive.c                     |   6 +-
hw/isa/isa-bus.c                         |  27 +++--
hw/isa/isa-superio.c                     |  20 ++--
hw/isa/piix4.c                           |   3 +-
hw/isa/vt82c686.c                        |  13 ++-
hw/m68k/mcf5208.c                        |   4 +-
hw/m68k/mcf_intc.c                       |   5 +-
hw/m68k/next-cube.c                      |  12 +-
hw/m68k/q800.c                           |  36 +++---
hw/microblaze/petalogix_ml605_mmu.c      |  24 ++--
hw/microblaze/petalogix_s3adsp1800_mmu.c |  12 +-
hw/microblaze/xlnx-zynqmp-pmu.c          |   6 +-
hw/mips/boston.c                         |  12 +-
hw/mips/fuloong2e.c                      |   6 +-
hw/mips/gt64xxx_pci.c                    |   5 +-
hw/mips/jazz.c                           |  16 +--
hw/mips/malta.c                          |   6 +-
hw/mips/mipssim.c                        |   8 +-
hw/misc/auxbus.c                         |  20 ++--
hw/misc/macio/macio.c                    |  56 ++++------
hw/net/etraxfs_eth.c                     |   4 +-
hw/net/fsl_etsec/etsec.c                 |   5 +-
hw/net/lan9118.c                         |   5 +-
hw/net/lasi_i82596.c                     |   5 +-
hw/net/smc91c111.c                       |   5 +-
hw/net/spapr_llan.c                      |   4 +-
hw/net/xilinx_axienet.c                  |   9 +-
hw/nios2/10m50_devboard.c                |  12 +-
hw/nvram/fw_cfg.c                        |   8 +-
hw/openrisc/openrisc_sim.c               |   8 +-
hw/pci-bridge/dec.c                      |   6 +-
hw/pci-bridge/pci_expander_bridge.c      |   8 +-
hw/pci-host/bonito.c                     |   9 +-
hw/pci-host/designware.c                 |   6 +-
hw/pci-host/gpex.c                       |   6 +-
hw/pci-host/i440fx.c                     |   4 +-
hw/pci-host/pnv_phb3.c                   |  15 +--
hw/pci-host/pnv_phb4.c                   |   9 +-
hw/pci-host/pnv_phb4_pec.c               |   6 +-
hw/pci-host/prep.c                       |   4 +-
hw/pci-host/q35.c                        |   6 +-
hw/pci-host/sabre.c                      |  13 ++-
hw/pci-host/versatile.c                  |   4 +-
hw/pci-host/xilinx-pcie.c                |   6 +-
hw/pci/pci.c                             |  31 +++---
hw/pci/pcie.c                            |   2 +-
hw/pci/shpc.c                            |   2 +-
hw/pcmcia/pxa2xx.c                       |   5 +-
hw/ppc/e500.c                            |  32 +++---
hw/ppc/mac_newworld.c                    |  46 ++++----
hw/ppc/mac_oldworld.c                    |  26 ++---
hw/ppc/pnv.c                             |  65 +++++------
hw/ppc/pnv_psi.c                         |   6 +-
hw/ppc/ppc440_uc.c                       |   8 +-
hw/ppc/prep.c                            |  35 +++---
hw/ppc/sam460ex.c                        |   4 +-
hw/ppc/spapr.c                           |  22 ++--
hw/ppc/spapr_irq.c                       |   4 +-
hw/ppc/spapr_pci.c                       |   3 +-
hw/ppc/spapr_vio.c                       |   4 +-
hw/ppc/virtex_ml507.c                    |   9 +-
hw/riscv/opentitan.c                     |   3 +-
hw/riscv/riscv_hart.c                    |   4 +-
hw/riscv/sifive_clint.c                  |   5 +-
hw/riscv/sifive_e.c                      |   4 +-
hw/riscv/sifive_e_prci.c                 |   5 +-
hw/riscv/sifive_plic.c                   |   5 +-
hw/riscv/sifive_test.c                   |   5 +-
hw/riscv/sifive_u.c                      |  12 +-
hw/riscv/virt.c                          |   8 +-
hw/rtc/m48t59-isa.c                      |   7 +-
hw/rtc/m48t59.c                          |   5 +-
hw/rtc/mc146818rtc.c                     |   4 +-
hw/rtc/sun4v-rtc.c                       |   5 +-
hw/s390x/ap-bridge.c                     |   4 +-
hw/s390x/css-bridge.c                    |   6 +-
hw/s390x/s390-pci-bus.c                  |   8 +-
hw/s390x/s390-virtio-ccw.c               |  12 +-
hw/s390x/sclp.c                          |  10 +-
hw/s390x/vhost-vsock-ccw.c               |   3 +-
hw/s390x/virtio-ccw-9p.c                 |   3 +-
hw/s390x/virtio-ccw-balloon.c            |   3 +-
hw/s390x/virtio-ccw-blk.c                |   3 +-
hw/s390x/virtio-ccw-crypto.c             |   3 +-
hw/s390x/virtio-ccw-gpu.c                |   3 +-
hw/s390x/virtio-ccw-input.c              |   3 +-
hw/s390x/virtio-ccw-net.c                |   3 +-
hw/s390x/virtio-ccw-rng.c                |   3 +-
hw/s390x/virtio-ccw-scsi.c               |   6 +-
hw/s390x/virtio-ccw-serial.c             |   3 +-
hw/scsi/scsi-bus.c                       |   4 +-
hw/scsi/spapr_vscsi.c                    |   4 +-
hw/sd/milkymist-memcard.c                |   4 +-
hw/sd/pxa2xx_mmci.c                      |   8 +-
hw/sd/ssi-sd.c                           |   4 +-
hw/sh4/r2d.c                             |  12 +-
hw/sparc/leon3.c                         |  20 ++--
hw/sparc/sun4m.c                         |  64 +++++------
hw/sparc64/sun4u.c                       |  50 +++++----
hw/ssi/aspeed_smc.c                      |   1 -
hw/ssi/imx_spi.c                         |   2 -
hw/ssi/mss-spi.c                         |   1 -
hw/ssi/ssi.c                             |  43 +-------
hw/ssi/xilinx_spi.c                      |   1 -
hw/ssi/xilinx_spips.c                    |   4 -
hw/usb/bus.c                             |  52 ++++-----
hw/usb/dev-serial.c                      |   4 +-
hw/virtio/vhost-scsi-pci.c               |   3 +-
hw/virtio/vhost-user-blk-pci.c           |   3 +-
hw/virtio/vhost-user-fs-pci.c            |   3 +-
hw/virtio/vhost-user-scsi-pci.c          |   3 +-
hw/virtio/vhost-vsock-pci.c              |   3 +-
hw/virtio/virtio-9p-pci.c                |   3 +-
hw/virtio/virtio-balloon-pci.c           |   3 +-
hw/virtio/virtio-blk-pci.c               |   3 +-
hw/virtio/virtio-crypto-pci.c            |   3 +-
hw/virtio/virtio-input-pci.c             |   3 +-
hw/virtio/virtio-iommu-pci.c             |   3 +-
hw/virtio/virtio-net-pci.c               |   3 +-
hw/virtio/virtio-pmem-pci.c              |   3 +-
hw/virtio/virtio-rng-pci.c               |   3 +-
hw/virtio/virtio-scsi-pci.c              |   3 +-
hw/virtio/virtio-serial-pci.c            |   3 +-
hw/virtio/virtio.c                       |   5 +-
hw/xen/xen-bus.c                         |   4 +-
hw/xen/xen-legacy-backend.c              |   7 +-
hw/xtensa/virt.c                         |   4 +-
hw/xtensa/xtfpga.c                       |   8 +-
migration/migration.c                    |   2 +-
qdev-monitor.c                           |   2 +-
qom/object.c                             |  19 +++-
251 files changed, 1244 insertions(+), 1326 deletions(-)
[PATCH v3 00/39] qdev: Rework how we plug into the parent bus
Posted by Markus Armbruster 3 years, 10 months ago
Paolo recently suggested "to move the bus argument (and thus
qdev_set_parent_bus) to qdev_init"[1], and that it "would be quite
large but hopefully scriptable"[2].  Nerd sniped!

The series is big, but at least the bigger patches are all mechanical.

It is based on my "[PATCH v3 00/24] Fixes around device realization".

I'm abstaining from cc'ing maintainers on mechanical conversions.  I
still cc: for patches I deem interesting, with related patches thrown
in for context.  Let me know if you think I should cc: more widely.

PATCH 01-03  	Preliminary cleanup
PATCH 04     	New qdev infrastructure
      	     	Commit message explains why the current state is
      	     	problematic, and how my work improves it.
PATCH 05-12  	Convert direct users of qdev
PATCH 13-17  	Convert PCI
PATCH 18-21  	Convert ISA
PATCH 22-25  	Convert SSI
PATCH 26-29  	Convert USB
PATCH 30     	Garbage collection
PATCH 31-34  	Convert aux-bus
PATCH 35-42  	Clean up around child device initialization
PATCH 43-52  	Convert sysbus
PATCH 53     	Stop pretending recursive realization is about to become
      	     	real
PATCH 54-56  	Convert bus-less devices
PATCH 57	Garbage collection
PATCH 58	Maintain MAINTAINERS

Enjoy!

v3:
* Rebased; noteworthy conflicts
  - PATCH 36+48+56: commit fe0fe4735e7 (new machine opentitan)
  - PATCH 47: commit 26cd0362dd4 (machines spike_v1.9.1 and
    spike_v1.10 are gone)
  - PATCH 48: commit 60bf734e64 and 3d46938bbb (new bmc2835
    children)
  - PATCH 48: v3 of "macio: Fix to realize "mos6522-cuda" and
    "mos6522-pmu" devices"
  Puh!
* PATCH 08: Coccinelle script in commit message fixed; patch unchanged
* PATCH 19: Two coding style fixes

v2:
* Rebased
* PATCH 02+03:
  Old PATCH 02 is actually a revert, replace by propert reverts
  [Philippe]
* PATCH 04:
  - Fix pasto [Alistair]
  - Rephrase qdev_realize_and_unref()'s contract [Paolo]
  - qdev_realize() passes on realize error unprefixed (because
    prefixes can pile up)
* PATCH 08:
  Drop unwanted code motion [Paolo]
* PATCH 09:
  - Make the Coccinelle script safer; output unchanged [Paolo]
  - Delete a Coccinelle rule that due to rebase applies just once;
    move its code changes (hw/char/serial.c, hw/display/ati.c,
    half of hw/display/sm501.c) to the next patch
  - Move changes to hw/arm/highbank.c to next patch, where they belong
* PATCH 31:
  New [Philippe]
* PATCH 32:
  Rename aux_realize_bus() to aux_bus_realize() [Philippe]
* PATCH 47:
  &dev->parent_obj doesn't work after rebase, use SYS_BUS_DEVICE(dev)
  instead
* PATCH 52:
  New [Philippe]
* PATCH 53:
  Clean up on realize error [David]
* PATCH 54:
  Don't restrict qdev_realize_and_unref() to non-null bus [Paolo]

[1]
Subject: Re: Infinite loop in bus_unparent(), qdev bug or qdev misuse?
Date: Mon, 4 May 2020 16:58:54 +0200
Message-ID: <6fc8633a-6d91-b83a-e6cd-5f714ccaf9ea@redhat.com>

[2]
Subject: Re: Infinite loop in bus_unparent(), qdev bug or qdev misuse?
Date: Tue, 5 May 2020 18:26:57 +0200
Message-ID: <a4df3ba3-4759-56ac-68f8-f75eea93e27e@redhat.com>

Based-on: <20200609122339.937862-1-armbru@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Daniel P. Berrange <berrange@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Cc: Alistair Francis <alistair@alistair23.me>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: David Gibson <david@gibson.dropbear.id.au>

Markus Armbruster (39):
  qdev: Rename qbus_realize() to qbus_init()
  Revert "hw/prep: realize the PCI root bus as part of the prep init"
  Revert "hw/versatile: realize the PCI root bus as part of the
    versatile init"
  qdev: New qdev_new(), qdev_realize(), etc.
  qdev: Put qdev_new() to use with Coccinelle
  qdev: Convert to qbus_realize(), qbus_unrealize()
  qdev: Convert to qdev_unrealize() with Coccinelle
  qdev: Convert to qdev_unrealize() manually
  qdev: Convert uses of qdev_create() with Coccinelle
  qdev: Convert uses of qdev_create() manually
  qdev: Convert uses of qdev_set_parent_bus() with Coccinelle
  qdev: Convert uses of qdev_set_parent_bus() manually
  pci: New pci_new(), pci_realize_and_unref() etc.
  hw/ppc: Eliminate two superfluous QOM casts
  pci: Convert uses of pci_create() etc. with Coccinelle
  pci: Convert uses of pci_create() etc. manually
  pci: pci_create(), pci_create_multifunction() are now unused, drop
  isa: New isa_new(), isa_realize_and_unref() etc.
  isa: Convert uses of isa_create() with Coccinelle
  isa: Convert uses of isa_create(), isa_try_create() manually
  isa: isa_create(), isa_try_create() are now unused, drop
  ssi: ssi_auto_connect_slaves() never does anything, drop
  ssi: Convert uses of ssi_create_slave_no_init() with Coccinelle
  ssi: Convert last use of ssi_create_slave_no_init() manually
  ssi: ssi_create_slave_no_init() is now unused, drop
  usb: New usb_new(), usb_realize_and_unref()
  usb: Convert uses of usb_create()
  usb: usb_create() is now unused, drop
  usb: Eliminate usb_try_create_simple()
  qdev: qdev_create(), qdev_try_create() are now unused, drop
  auxbus: Rename aux_init_bus() to aux_bus_init()
  auxbus: New aux_bus_realize(), pairing with aux_bus_init()
  auxbus: Convert a use of qdev_set_parent_bus()
  auxbus: Eliminate aux_create_slave()
  qom: Tidy up a few object_initialize_child() calls
  qom: Less verbose object_initialize_child()
  macio: Convert use of qdev_set_parent_bus()
  macio: Eliminate macio_init_child_obj()
  sysbus: Drop useless OBJECT() in sysbus_init_child_obj() calls

 hw/lm32/lm32.h                           |  13 ++-
 hw/lm32/milkymist-hw.h                   |  37 ++++---
 include/hw/audio/pcspk.h                 |   5 +-
 include/hw/char/cadence_uart.h           |   5 +-
 include/hw/char/cmsdk-apb-uart.h         |   4 +-
 include/hw/char/pl011.h                  |   9 +-
 include/hw/char/xilinx_uartlite.h        |   4 +-
 include/hw/cris/etraxfs.h                |   4 +-
 include/hw/isa/isa.h                     |   5 +-
 include/hw/misc/auxbus.h                 |  18 +--
 include/hw/misc/unimp.h                  |   5 +-
 include/hw/net/ne2000-isa.h              |   5 +-
 include/hw/pci/pci.h                     |   6 +-
 include/hw/qdev-core.h                   |  12 +-
 include/hw/ssi/ssi.h                     |   5 -
 include/hw/timer/cmsdk-apb-timer.h       |   4 +-
 include/hw/timer/i8254.h                 |   9 +-
 include/hw/usb.h                         |   6 +-
 include/qom/object.h                     |  30 ++++-
 hw/acpi/pcihp.c                          |   2 +-
 hw/acpi/piix4.c                          |   6 +-
 hw/alpha/typhoon.c                       |   4 +-
 hw/arm/allwinner-a10.c                   |   9 +-
 hw/arm/allwinner-h3.c                    |   5 +-
 hw/arm/armsse.c                          |  26 ++---
 hw/arm/aspeed.c                          |  15 ++-
 hw/arm/aspeed_ast2600.c                  |  43 +++-----
 hw/arm/aspeed_soc.c                      |  39 +++----
 hw/arm/bcm2836.c                         |   3 +-
 hw/arm/cubieboard.c                      |   4 +-
 hw/arm/digic.c                           |   4 +-
 hw/arm/exynos4210.c                      |  44 ++++----
 hw/arm/exynos4_boards.c                  |   4 +-
 hw/arm/fsl-imx25.c                       |   4 +-
 hw/arm/fsl-imx31.c                       |   4 +-
 hw/arm/fsl-imx6.c                        |   5 +-
 hw/arm/fsl-imx6ul.c                      |   4 +-
 hw/arm/fsl-imx7.c                        |   5 +-
 hw/arm/highbank.c                        |  26 ++---
 hw/arm/imx25_pdk.c                       |   8 +-
 hw/arm/integratorcp.c                    |   4 +-
 hw/arm/kzm.c                             |   3 +-
 hw/arm/mcimx6ul-evk.c                    |   5 +-
 hw/arm/mcimx7d-sabre.c                   |   5 +-
 hw/arm/mps2-tz.c                         |  18 ++-
 hw/arm/msf2-som.c                        |  12 +-
 hw/arm/musca.c                           |  14 +--
 hw/arm/musicpal.c                        |   8 +-
 hw/arm/netduino2.c                       |   4 +-
 hw/arm/netduinoplus2.c                   |   4 +-
 hw/arm/nrf51_soc.c                       |   2 +-
 hw/arm/nseries.c                         |   8 +-
 hw/arm/omap1.c                           |  16 +--
 hw/arm/omap2.c                           |  16 +--
 hw/arm/orangepi.c                        |   4 +-
 hw/arm/pxa2xx.c                          |   8 +-
 hw/arm/pxa2xx_gpio.c                     |   5 +-
 hw/arm/pxa2xx_pic.c                      |   5 +-
 hw/arm/raspi.c                           |   8 +-
 hw/arm/realview.c                        |  20 ++--
 hw/arm/sabrelite.c                       |   4 +-
 hw/arm/sbsa-ref.c                        |  24 ++--
 hw/arm/spitz.c                           |   4 +-
 hw/arm/stellaris.c                       |  12 +-
 hw/arm/stm32f405_soc.c                   |   6 +-
 hw/arm/strongarm.c                       |   9 +-
 hw/arm/versatilepb.c                     |  16 +--
 hw/arm/vexpress.c                        |  16 +--
 hw/arm/virt.c                            |  36 +++---
 hw/arm/xilinx_zynq.c                     |  42 +++----
 hw/arm/xlnx-versal-virt.c                |   9 +-
 hw/arm/xlnx-versal.c                     |   9 +-
 hw/arm/xlnx-zcu102.c                     |  24 ++--
 hw/arm/xlnx-zynqmp.c                     |  16 +--
 hw/audio/intel-hda.c                     |   4 +-
 hw/block/fdc.c                           |  16 +--
 hw/block/nand.c                          |   2 +-
 hw/block/pflash_cfi01.c                  |   4 +-
 hw/block/pflash_cfi02.c                  |   4 +-
 hw/block/xen-block.c                     |   4 +-
 hw/char/exynos4210_uart.c                |   5 +-
 hw/char/mcf_uart.c                       |   5 +-
 hw/char/parallel-isa.c                   |   5 +-
 hw/char/serial-isa.c                     |   7 +-
 hw/char/serial-pci-multi.c               |   6 +-
 hw/char/serial-pci.c                     |   5 +-
 hw/char/serial.c                         |  10 +-
 hw/char/spapr_vty.c                      |   4 +-
 hw/core/bus.c                            |  23 +++-
 hw/core/empty_slot.c                     |   5 +-
 hw/core/qdev.c                           | 134 +++++++++++++++--------
 hw/core/sysbus.c                         |   9 +-
 hw/cris/axis_dev88.c                     |   4 +-
 hw/display/ati.c                         |   5 +-
 hw/display/milkymist-tmu2.c              |   4 +-
 hw/display/sm501.c                       |   9 +-
 hw/display/virtio-gpu-pci.c              |   3 +-
 hw/display/virtio-vga.c                  |   3 +-
 hw/display/xlnx_dp.c                     |  13 ++-
 hw/dma/i8257.c                           |   9 +-
 hw/dma/pxa2xx_dma.c                      |   8 +-
 hw/dma/rc4030.c                          |   5 +-
 hw/dma/sparc32_dma.c                     |  16 +--
 hw/dma/xilinx_axidma.c                   |   9 +-
 hw/hppa/dino.c                           |   4 +-
 hw/hppa/lasi.c                           |   4 +-
 hw/hppa/machine.c                        |   4 +-
 hw/i2c/core.c                            |   5 +-
 hw/i2c/smbus_eeprom.c                    |   4 +-
 hw/i386/amd_iommu.c                      |   3 +-
 hw/i386/pc.c                             |  12 +-
 hw/i386/pc_q35.c                         |  14 +--
 hw/i386/pc_sysfw.c                       |   4 +-
 hw/i386/x86.c                            |   6 +-
 hw/ide/isa.c                             |   5 +-
 hw/ide/qdev.c                            |   4 +-
 hw/intc/exynos4210_gic.c                 |   5 +-
 hw/intc/i8259_common.c                   |   5 +-
 hw/intc/pnv_xive.c                       |   6 +-
 hw/intc/s390_flic.c                      |   6 +-
 hw/intc/spapr_xive.c                     |   6 +-
 hw/isa/isa-bus.c                         |  27 +++--
 hw/isa/isa-superio.c                     |  20 ++--
 hw/isa/piix4.c                           |   3 +-
 hw/isa/vt82c686.c                        |  13 ++-
 hw/m68k/mcf5208.c                        |   4 +-
 hw/m68k/mcf_intc.c                       |   5 +-
 hw/m68k/next-cube.c                      |  12 +-
 hw/m68k/q800.c                           |  36 +++---
 hw/microblaze/petalogix_ml605_mmu.c      |  24 ++--
 hw/microblaze/petalogix_s3adsp1800_mmu.c |  12 +-
 hw/microblaze/xlnx-zynqmp-pmu.c          |   6 +-
 hw/mips/boston.c                         |  12 +-
 hw/mips/fuloong2e.c                      |   6 +-
 hw/mips/gt64xxx_pci.c                    |   5 +-
 hw/mips/jazz.c                           |  16 +--
 hw/mips/malta.c                          |   6 +-
 hw/mips/mipssim.c                        |   8 +-
 hw/misc/auxbus.c                         |  20 ++--
 hw/misc/macio/macio.c                    |  56 ++++------
 hw/net/etraxfs_eth.c                     |   4 +-
 hw/net/fsl_etsec/etsec.c                 |   5 +-
 hw/net/lan9118.c                         |   5 +-
 hw/net/lasi_i82596.c                     |   5 +-
 hw/net/smc91c111.c                       |   5 +-
 hw/net/spapr_llan.c                      |   4 +-
 hw/net/xilinx_axienet.c                  |   9 +-
 hw/nios2/10m50_devboard.c                |  12 +-
 hw/nvram/fw_cfg.c                        |   8 +-
 hw/openrisc/openrisc_sim.c               |   8 +-
 hw/pci-bridge/dec.c                      |   6 +-
 hw/pci-bridge/pci_expander_bridge.c      |   8 +-
 hw/pci-host/bonito.c                     |   9 +-
 hw/pci-host/designware.c                 |   6 +-
 hw/pci-host/gpex.c                       |   6 +-
 hw/pci-host/i440fx.c                     |   4 +-
 hw/pci-host/pnv_phb3.c                   |  15 +--
 hw/pci-host/pnv_phb4.c                   |   9 +-
 hw/pci-host/pnv_phb4_pec.c               |   6 +-
 hw/pci-host/prep.c                       |   4 +-
 hw/pci-host/q35.c                        |   6 +-
 hw/pci-host/sabre.c                      |  13 ++-
 hw/pci-host/versatile.c                  |   4 +-
 hw/pci-host/xilinx-pcie.c                |   6 +-
 hw/pci/pci.c                             |  31 +++---
 hw/pci/pcie.c                            |   2 +-
 hw/pci/shpc.c                            |   2 +-
 hw/pcmcia/pxa2xx.c                       |   5 +-
 hw/ppc/e500.c                            |  32 +++---
 hw/ppc/mac_newworld.c                    |  46 ++++----
 hw/ppc/mac_oldworld.c                    |  26 ++---
 hw/ppc/pnv.c                             |  65 +++++------
 hw/ppc/pnv_psi.c                         |   6 +-
 hw/ppc/ppc440_uc.c                       |   8 +-
 hw/ppc/prep.c                            |  35 +++---
 hw/ppc/sam460ex.c                        |   4 +-
 hw/ppc/spapr.c                           |  22 ++--
 hw/ppc/spapr_irq.c                       |   4 +-
 hw/ppc/spapr_pci.c                       |   3 +-
 hw/ppc/spapr_vio.c                       |   4 +-
 hw/ppc/virtex_ml507.c                    |   9 +-
 hw/riscv/opentitan.c                     |   3 +-
 hw/riscv/riscv_hart.c                    |   4 +-
 hw/riscv/sifive_clint.c                  |   5 +-
 hw/riscv/sifive_e.c                      |   4 +-
 hw/riscv/sifive_e_prci.c                 |   5 +-
 hw/riscv/sifive_plic.c                   |   5 +-
 hw/riscv/sifive_test.c                   |   5 +-
 hw/riscv/sifive_u.c                      |  12 +-
 hw/riscv/virt.c                          |   8 +-
 hw/rtc/m48t59-isa.c                      |   7 +-
 hw/rtc/m48t59.c                          |   5 +-
 hw/rtc/mc146818rtc.c                     |   4 +-
 hw/rtc/sun4v-rtc.c                       |   5 +-
 hw/s390x/ap-bridge.c                     |   4 +-
 hw/s390x/css-bridge.c                    |   6 +-
 hw/s390x/s390-pci-bus.c                  |   8 +-
 hw/s390x/s390-virtio-ccw.c               |  12 +-
 hw/s390x/sclp.c                          |  10 +-
 hw/s390x/vhost-vsock-ccw.c               |   3 +-
 hw/s390x/virtio-ccw-9p.c                 |   3 +-
 hw/s390x/virtio-ccw-balloon.c            |   3 +-
 hw/s390x/virtio-ccw-blk.c                |   3 +-
 hw/s390x/virtio-ccw-crypto.c             |   3 +-
 hw/s390x/virtio-ccw-gpu.c                |   3 +-
 hw/s390x/virtio-ccw-input.c              |   3 +-
 hw/s390x/virtio-ccw-net.c                |   3 +-
 hw/s390x/virtio-ccw-rng.c                |   3 +-
 hw/s390x/virtio-ccw-scsi.c               |   6 +-
 hw/s390x/virtio-ccw-serial.c             |   3 +-
 hw/scsi/scsi-bus.c                       |   4 +-
 hw/scsi/spapr_vscsi.c                    |   4 +-
 hw/sd/milkymist-memcard.c                |   4 +-
 hw/sd/pxa2xx_mmci.c                      |   8 +-
 hw/sd/ssi-sd.c                           |   4 +-
 hw/sh4/r2d.c                             |  12 +-
 hw/sparc/leon3.c                         |  20 ++--
 hw/sparc/sun4m.c                         |  64 +++++------
 hw/sparc64/sun4u.c                       |  50 +++++----
 hw/ssi/aspeed_smc.c                      |   1 -
 hw/ssi/imx_spi.c                         |   2 -
 hw/ssi/mss-spi.c                         |   1 -
 hw/ssi/ssi.c                             |  43 +-------
 hw/ssi/xilinx_spi.c                      |   1 -
 hw/ssi/xilinx_spips.c                    |   4 -
 hw/usb/bus.c                             |  52 ++++-----
 hw/usb/dev-serial.c                      |   4 +-
 hw/virtio/vhost-scsi-pci.c               |   3 +-
 hw/virtio/vhost-user-blk-pci.c           |   3 +-
 hw/virtio/vhost-user-fs-pci.c            |   3 +-
 hw/virtio/vhost-user-scsi-pci.c          |   3 +-
 hw/virtio/vhost-vsock-pci.c              |   3 +-
 hw/virtio/virtio-9p-pci.c                |   3 +-
 hw/virtio/virtio-balloon-pci.c           |   3 +-
 hw/virtio/virtio-blk-pci.c               |   3 +-
 hw/virtio/virtio-crypto-pci.c            |   3 +-
 hw/virtio/virtio-input-pci.c             |   3 +-
 hw/virtio/virtio-iommu-pci.c             |   3 +-
 hw/virtio/virtio-net-pci.c               |   3 +-
 hw/virtio/virtio-pmem-pci.c              |   3 +-
 hw/virtio/virtio-rng-pci.c               |   3 +-
 hw/virtio/virtio-scsi-pci.c              |   3 +-
 hw/virtio/virtio-serial-pci.c            |   3 +-
 hw/virtio/virtio.c                       |   5 +-
 hw/xen/xen-bus.c                         |   4 +-
 hw/xen/xen-legacy-backend.c              |   7 +-
 hw/xtensa/virt.c                         |   4 +-
 hw/xtensa/xtfpga.c                       |   8 +-
 migration/migration.c                    |   2 +-
 qdev-monitor.c                           |   2 +-
 qom/object.c                             |  19 +++-
 251 files changed, 1244 insertions(+), 1326 deletions(-)

-- 
2.26.2


Re: [PATCH v3 00/39] qdev: Rework how we plug into the parent bus
Posted by Markus Armbruster 3 years, 10 months ago
Incomplete, please ignore.  Sorry for the noise!