qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] e8512d: qom: Constify object_get_canonical_pa


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] e8512d: qom: Constify object_get_canonical_path{, _componen...
Date: Tue, 16 Jun 2020 05:30:35 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: e8512dfa4d320e83b7dd4d994a3e404060c5b49b
      
https://github.com/qemu/qemu/commit/e8512dfa4d320e83b7dd4d994a3e404060c5b49b
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M include/qom/object.h
    M qom/object.c

  Log Message:
  -----------
  qom: Constify object_get_canonical_path{,_component}()'s parameter

Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200527084754.7531-2-armbru@redhat.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>


  Commit: e8c9e65816f5dbfe18ad3b2be938d0d8192d459a
      
https://github.com/qemu/qemu/commit/e8c9e65816f5dbfe18ad3b2be938d0d8192d459a
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M qom/qom-hmp-cmds.c

  Log Message:
  -----------
  qom: Make "info qom-tree" show children sorted

"info qom-tree" prints children in unstable order.  This is a pain
when diffing output for different versions to find change.  Print it
sorted.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200527084754.7531-3-armbru@redhat.com>
Tested-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>


  Commit: 2fb1f7d29932db2908bdaad0f03c326e800d5e62
      
https://github.com/qemu/qemu/commit/2fb1f7d29932db2908bdaad0f03c326e800d5e62
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/arm/stm32f405_soc.c

  Log Message:
  -----------
  arm/stm32f405: Fix realization of "stm32f2xx-adc" devices

stm32f405_soc_initfn() creates six such devices, but
stm32f405_soc_realize() realizes only one.  Affects machine
netduinoplus2.

In theory, a device becomes real only on realize.  In practice, the
transition from unreal to real is a fuzzy one.  The work to make a
device real can be spread between realize methods (fine),
instance_init methods (wrong), and board code wiring up the device
(fine as long as it effectively happens on realize).  Depending on
what exactly is done where, a device can work even when we neglect
to realize it.

The five unrealized devices appear to stay unreal: neither MMIO nor
IRQ get wired up.

Fix stm32f405_soc_realize() to realize and wire up all six.  Visible
in "info qtree":

     bus: main-system-bus
       type System
       dev: stm32f405-soc, id ""
         cpu-type = "cortex-m4-arm-cpu"
       dev: stm32f2xx-adc, id ""
         gpio-out "sysbus-irq" 1
    -    mmio ffffffffffffffff/00000000000000ff
    +    mmio 0000000040012000/00000000000000ff
       dev: stm32f2xx-adc, id ""
         gpio-out "sysbus-irq" 1
    -    mmio ffffffffffffffff/00000000000000ff
    +    mmio 0000000040012100/00000000000000ff
       dev: stm32f2xx-adc, id ""
         gpio-out "sysbus-irq" 1
    -    mmio ffffffffffffffff/00000000000000ff
    +    mmio 0000000040012200/00000000000000ff
       dev: stm32f2xx-adc, id ""
         gpio-out "sysbus-irq" 1
    -    mmio ffffffffffffffff/00000000000000ff
    +    mmio 0000000040012300/00000000000000ff
       dev: stm32f2xx-adc, id ""
         gpio-out "sysbus-irq" 1
    -    mmio 0000000040012000/00000000000000ff
    +    mmio 0000000040012400/00000000000000ff
       dev: stm32f2xx-adc, id ""
         gpio-out "sysbus-irq" 1
    -    mmio ffffffffffffffff/00000000000000ff
    +    mmio 0000000040012500/00000000000000ff
       dev: armv7m, id ""

Fixes: 529fc5fd3e18ace8f739afd02dc0953354f39442
Cc: Alistair Francis <alistair@alistair23.me>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200609122339.937862-2-armbru@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>


  Commit: f6a1f93d6a43c6ede9f32de3b4ccb126998f322e
      
https://github.com/qemu/qemu/commit/f6a1f93d6a43c6ede9f32de3b4ccb126998f322e
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/display/xlnx_dp.c

  Log Message:
  -----------
  display/xlnx_dp: Fix to realize "i2c-ddc" and "aux-to-i2c-bridge"

xlnx_dp_init() creates these two devices, but they're never realized.
Affects machine xlnx-zcu102.

In theory, a device becomes real only on realize.  In practice, the
transition from unreal to real is a fuzzy one.  The work to make a
device real can be spread between realize methods (fine),
instance_init methods (wrong), and board code wiring up the device
(fine as long as it effectively happens on realize).  Depending on
what exactly is done where, a device can work even when we neglect to
realize it.

These two appear to work.  Nevertheless, it's a clear misuse of the
interface.  Even when it works today (more or less by chance), it can
break tomorrow.

Fix by realizing them in xlnx_dp_realize().

Fixes: 58ac482a66de09a7590f705e53fc6a3fb8a055e8
Cc: KONRAD Frederic <fred.konrad@greensocs.com>
Cc: Alistair Francis <alistair@alistair23.me>
Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20200609122339.937862-3-armbru@redhat.com>


  Commit: 71e5770b618a2a10d9f92eade0ea0f2c8aaca58d
      
https://github.com/qemu/qemu/commit/71e5770b618a2a10d9f92eade0ea0f2c8aaca58d
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/sd/pxa2xx_mmci.c

  Log Message:
  -----------
  sd/pxa2xx_mmci: Fix to realize "pxa2xx-mmci" device

pxa2xx_mmci_init() creates a "pxa2xx-mmci" device, but neglects to
realize it.  Affects machines akita, borzoi, connex, mainstone, spitz,
terrier, tosa, verdex, and z2.

In theory, a device becomes real only on realize.  In practice, the
transition from unreal to real is a fuzzy one.  The work to make a
device real can be spread between realize methods (fine),
instance_init methods (wrong), and board code wiring up the device
(fine as long as it effectively happens on realize).  Depending on
what exactly is done where, a device can work even when we neglect
to realize it.

This one appears to work.  Nevertheless, it's a clear misuse of the
interface.  Even when it works today (more or less by chance), it can
break tomorrow.

Fix by realizing it right away.  Visible in "info qom-tree"; here's
the change for akita:

     /machine (akita-machine)
       [...]
       /unattached (container)
         [...]
    +    /device[5] (pxa2xx-mmci)
    +      /pxa2xx-mmci[0] (qemu:memory-region)
    +      /sd-bus (pxa2xx-mmci-bus)
         [rest of device[*] renumbered...]

Fixes: 7a9468c92517e19037bfe2272f64f5dadaf9db15
Cc: Andrzej Zaborowski <balrogg@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200609122339.937862-4-armbru@redhat.com>


  Commit: b7f1a0cb7663eca31c8e8f7b247eaf1c9782b104
      
https://github.com/qemu/qemu/commit/b7f1a0cb7663eca31c8e8f7b247eaf1c9782b104
  Author: Cédric Le Goater <clg@kaod.org>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/arm/aspeed.c
    M hw/arm/aspeed_ast2600.c
    M hw/arm/aspeed_soc.c
    M include/hw/arm/aspeed_soc.h

  Log Message:
  -----------
  arm/aspeed: Compute the number of CPUs from the SoC definition

Commit ece09beec457 ("aspeed: introduce a configurable number of CPU
per machine") was a convient change during bringup but the Aspeed SoCs
have a fixed number of CPUs : one for the AST2400 and AST2500, and two
for the AST2600.

When the number of CPUs configured with -smp is less than the SoC's
fixed number, the "unconfigured" CPUs are left unrealized. This can
happen for machines ast2600-evb and tacoma-bmc, where the SoC's fixed
number is 2. To get virtual hardware that matches the physical
hardware, you have to pass -smp cpus=2 (or its sugared form -smp 2).

We normally reject -smp cpus=N when N exceeds the machine's limit.
Except we ignore cpus=2 (and only cpus=2) with a warning for machines
ast2500-evb, palmetto-bmc, romulus-bmc, sonorapass-bmc, swift-bmc, and
witherspoon-bmc.

Remove the "num-cpu" property from the SoC state and use the fixed
number of CPUs defined in the SoC class instead. Compute the default,
min, max number of CPUs of the machine directly from the SoC class
definition.

Machines ast2600-evb and tacoma-bmc now always get their second CPU as
they should. Visible in "info qom-tree"; here's the change for
ast2600-evb:

     /machine (ast2600-evb-machine)
       /peripheral (container)
       /peripheral-anon (container)
       /soc (ast2600-a1)
         /a7mpcore (a15mpcore_priv)
           /a15mp-priv-container[0] (qemu:memory-region)
           /gic (arm_gic)
             /gic_cpu[0] (qemu:memory-region)
             /gic_cpu[1] (qemu:memory-region)
    +        /gic_cpu[2] (qemu:memory-region)
             /gic_dist[0] (qemu:memory-region)
             /gic_vcpu[0] (qemu:memory-region)
             /gic_viface[0] (qemu:memory-region)
             /gic_viface[1] (qemu:memory-region)
    +        /gic_viface[2] (qemu:memory-region)
             /unnamed-gpio-in[0] (irq)
             [...]
    +        /unnamed-gpio-in[160] (irq)
             [same for 161 to 190...]
    +        /unnamed-gpio-in[191] (irq)

Also visible in "info qtree"; here's the change for ast2600-evb:

     bus: main-system-bus
       type System
       dev: a15mpcore_priv, id ""
         gpio-in "" 128
    -    gpio-out "sysbus-irq" 5
    -    num-cpu = 1 (0x1)
    +    gpio-out "sysbus-irq" 10
    +    num-cpu = 2 (0x2)
         num-irq = 160 (0xa0)
         mmio 0000000040460000/0000000000008000
       dev: arm_gic, id ""
    -    gpio-in "" 160
    -    num-cpu = 1 (0x1)
    +    gpio-in "" 192
    +    num-cpu = 2 (0x2)
         num-irq = 160 (0xa0)
         revision = 2 (0x2)
         has-security-extensions = true
         has-virtualization-extensions = true
         num-priority-bits = 8 (0x8)
         mmio ffffffffffffffff/0000000000001000
         mmio ffffffffffffffff/0000000000002000
         mmio ffffffffffffffff/0000000000001000
         mmio ffffffffffffffff/0000000000002000
         mmio ffffffffffffffff/0000000000000100
    +    mmio ffffffffffffffff/0000000000000100
    +    mmio ffffffffffffffff/0000000000000200
         mmio ffffffffffffffff/0000000000000200

The other machines now reject -smp cpus=2 just like -smp cpus=3 and up.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Commit message expanded]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200609122339.937862-5-armbru@redhat.com>


  Commit: d3bad7e7c48f8c33b28cd5a472c89a53dfe56f9b
      
https://github.com/qemu/qemu/commit/d3bad7e7c48f8c33b28cd5a472c89a53dfe56f9b
  Author: Cédric Le Goater <clg@kaod.org>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/arm/aspeed.c
    M hw/arm/aspeed_ast2600.c
    M hw/arm/aspeed_soc.c
    M include/hw/arm/aspeed.h

  Log Message:
  -----------
  arm/aspeed: Rework NIC attachment

The number of MACs supported by an Aspeed SoC is defined by "macs_num"
under the SoC model, that is two for the AST2400 and AST2500 and four
for the AST2600. The model initializes the maximum number of supported
MACs but the number of realized devices is capped by the number of
network device back-ends defined on the command line. This can leave
unrealized devices hanging around in the QOM composition tree.

To get virtual hardware that matches the physical hardware, you have
to pass exactly as many -nic options as there are MACs, and some of
them must be -nic none:

* Machines ast2500-evb, palmetto-bmc, romulus-bmc, sonorapass-bmc,
  swift-bmc, and witherspoon-bmc: two -nic, and the second one must be
  -nic none.

* Machine ast2600-evb: four -nic, the first one must be -nic none.

* Machine tacoma-bmc: four nic, the first two and the last one must be
  -nic none.

Modify the machine initialization to define which MACs are attached to
a network device back-end using a bit-field property "macs-mask" and
let the SoC realize all network devices.

The default setting of "macs-mask" is "use MAC0" only, which works for
all our AST2400 and AST2500 machines. The AST2600 machines have
different configurations. The AST2600 EVB machine activates MAC1, MAC2
and MAC3 and the Tacoma BMC machine activates MAC2.

Incompatible CLI change: -nic options now apply to *active* MACs:
MAC1, MAC2, MAC3 for ast2600-evb, MAC2 for tacoma-bmc, and MAC0 for
all the others.

The machines now always get all MACs as they should. Visible in "info
qom-tree", here's the change for tacoma-bmc:

     /machine (tacoma-bmc-machine)
       /peripheral (container)
       /peripheral-anon (container)
       /soc (ast2600-a1)
         [...]
         /ftgmac100[0] (ftgmac100)
           /ftgmac100[0] (qemu:memory-region)
         /ftgmac100[1] (ftgmac100)
    +      /ftgmac100[0] (qemu:memory-region)
         /ftgmac100[2] (ftgmac100)
    +      /ftgmac100[0] (qemu:memory-region)
         /ftgmac100[3] (ftgmac100)
    +      /ftgmac100[0] (qemu:memory-region)
         [...]
         /mii[0] (aspeed-mmi)
           /aspeed-mmi[0] (qemu:memory-region)
         /mii[1] (aspeed-mmi)
    +      /aspeed-mmi[0] (qemu:memory-region)
         /mii[2] (aspeed-mmi)
    +      /aspeed-mmi[0] (qemu:memory-region)
         /mii[3] (aspeed-mmi)
    +      /aspeed-mmi[0] (qemu:memory-region)

Also visible in "info qtree"; here's the change for tacoma-bmc:

       dev: ftgmac100, id ""
         gpio-out "sysbus-irq" 1
         aspeed = true
    -    mac = "52:54:00:12:34:56"
    -    netdev = "hub0port0"
    +    mac = "52:54:00:12:34:57"
    +    netdev = ""
         mmio 000000001e660000/0000000000002000
       dev: ftgmac100, id ""
    -    aspeed = false
    -    mac = "00:00:00:00:00:00"
    +    gpio-out "sysbus-irq" 1
    +    aspeed = true
    +    mac = "52:54:00:12:34:58"
         netdev = ""
    +    mmio 000000001e680000/0000000000002000
       dev: ftgmac100, id ""
    -    aspeed = false
    -    mac = "00:00:00:00:00:00"
    -    netdev = ""
    +    gpio-out "sysbus-irq" 1
    +    aspeed = true
    +    mac = "52:54:00:12:34:56"
    +    netdev = "hub0port0"
    +    mmio 000000001e670000/0000000000002000
       dev: ftgmac100, id ""
    -    aspeed = false
    -    mac = "00:00:00:00:00:00"
    +    gpio-out "sysbus-irq" 1
    +    aspeed = true
    +    mac = "52:54:00:12:34:59"
         netdev = ""
    +    mmio 000000001e690000/0000000000002000
       [...]
       dev: aspeed-mmi, id ""
         mmio 000000001e650000/0000000000000008
       dev: aspeed-mmi, id ""
    +    mmio 000000001e650008/0000000000000008
       dev: aspeed-mmi, id ""
    +    mmio 000000001e650010/0000000000000008
       dev: aspeed-mmi, id ""
    +    mmio 000000001e650018/0000000000000008

Inactive MACs will have no peer and QEMU may warn the user with :

    qemu-system-arm: warning: nic ftgmac100.0 has no peer
    qemu-system-arm: warning: nic ftgmac100.1 has no peer
    qemu-system-arm: warning: nic ftgmac100.3 has no peer

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
[Commit message expanded]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200609122339.937862-6-armbru@redhat.com>


  Commit: 210d18674a34bb43bd05cdd68d24fd03e161ff3d
      
https://github.com/qemu/qemu/commit/210d18674a34bb43bd05cdd68d24fd03e161ff3d
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/arm/armv7m.c

  Log Message:
  -----------
  armv7m: Delete unused "ARM,bitband-memory" devices

These devices are optional, and enabled by property "enable-bitband".
armv7m_instance_init() creates them unconditionally, because the
property has not been set then.  armv7m_realize() realizes them only
when the property is true.  Works, although it leaves unrealized
devices hanging around in the QOM composition tree.  Affects machines
microbit, mps2-an505, mps2-an521, musca-a, and musca-b1.

Delete the unused devices by making armv7m_realize() unparent them.
Visible in "info qom-tree"; here's the change for microbit:

     /machine (microbit-machine)
       /microbit.twi (microbit.i2c)
         /microbit.twi[0] (qemu:memory-region)
       /nrf51 (nrf51-soc)
         /armv6m (armv7m)
           /armv7m-container[0] (qemu:memory-region)
    -      /bitband[0] (ARM,bitband-memory)
    -        /bitband[0] (qemu:memory-region)
    -      /bitband[1] (ARM,bitband-memory)
    -        /bitband[0] (qemu:memory-region)
           /cpu (cortex-m0-arm-cpu)

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20200609122339.937862-7-armbru@redhat.com>


  Commit: 6b888ee28c8801b346eb41655b36207a28ce146b
      
https://github.com/qemu/qemu/commit/6b888ee28c8801b346eb41655b36207a28ce146b
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/misc/auxbus.c

  Log Message:
  -----------
  auxbus: Fix aux-to-i2c-bridge to be a subtype of aux-slave

We plug aux-to-i2c-bridge into the aux-bus, even though its
DeviceClass member bus_type is null, not TYPE_AUX_BUS.  Fix that by
deriving it from TYPE_AUX_SLAVE instead of TYPE_DEVICE.

Cc: KONRAD Frederic <fred.konrad@greensocs.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200609122339.937862-8-armbru@redhat.com>


  Commit: 5e769ecf509089c053bb247ae48a360ef8e87d66
      
https://github.com/qemu/qemu/commit/5e769ecf509089c053bb247ae48a360ef8e87d66
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/misc/mac_via.c

  Log Message:
  -----------
  mac_via: Fix to realize "mos6522-q800-via*" devices

mac_via_realize() creates a "mos6522-q800-via1" and a
"mos6522-q800-via2" device, but neglects to realize them.  Affects
machine q800.

In theory, a device becomes real only on realize.  In practice, the
transition from unreal to real is a fuzzy one.  The work to make a
device real can be spread between realize methods (fine),
instance_init methods (wrong), and board code wiring up the device
(fine as long as it effectively happens on realize).  Depending on
what exactly is done where, a device can work even when we neglect
to realize it.

These two appear to work.  Nevertheless, it's a clear misuse of the
interface.  Even when it works today (more or less by chance), it can
break tomorrow.

Fix by realizing them right away.

Fixes: 6dca62a0000f95e0b7020aa00d0ca9b2c421f341
Cc: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20200609122339.937862-9-armbru@redhat.com>
Tested-by: Laurent Vivier <laurent@vivier.eu>
Acked-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 3d81f594fdcd6c2737a52dcb19552a298f2af9e1
      
https://github.com/qemu/qemu/commit/3d81f594fdcd6c2737a52dcb19552a298f2af9e1
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/misc/macio/cuda.c
    M hw/misc/macio/pmu.c

  Log Message:
  -----------
  macio: Fix to realize "mos6522-cuda" and "mos6522-pmu" devices

cuda_init() creates a "mos6522-cuda" device, but it's never realized.
Affects machines mac99 with via=cuda (default) and g3beige.

pmu_init() creates a "mos6522-pmu" device, but it's never realized.
Affects machine mac99 with via=pmu and via=pmu-adb,

In theory, a device becomes real only on realize.  In practice, the
transition from unreal to real is a fuzzy one.  The work to make a
device real can be spread between realize methods (fine),
instance_init methods (wrong), and board code wiring up the device
(fine as long as it effectively happens on realize).  Depending on
what exactly is done where, a device can work even when we neglect
to realize it.

These two appear to work.  Nevertheless, it's a clear misuse of the
interface.  Even when it works today (more or less by chance), it can
break tomorrow.

Fix by realizing them in cuda_realize() and pmu_realize(),
respectively.

Fixes: 6dca62a0000f95e0b7020aa00d0ca9b2c421f341
Cc: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200609122339.937862-10-armbru@redhat.com>


  Commit: 33208432f5fdd459c98237872e480ef82f435419
      
https://github.com/qemu/qemu/commit/33208432f5fdd459c98237872e480ef82f435419
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/misc/macio/macio.c

  Log Message:
  -----------
  macio: Delete unused "macio-gpio" devices

These devices go with the "via-pmu" device, which is controlled by
property "has-pmu".  macio_newworld_init() creates it unconditionally,
because the property has not been set then.  macio_newworld_realize()
realizes it only when the property is true.  Works, although it can
leave an unrealized device hanging around in the QOM composition tree.
Affects machine mac99 with via=cuda (default).

Delete the unused device by making macio_newworld_realize() unparent
it.  Visible in "info qom-tree":

     /machine (mac99-machine)
       [...]
       /unattached (container)
         /device[9] (macio-newworld)
           [...]
           /escc-legacy-port[8] (qemu:memory-region)
           /escc-legacy-port[9] (qemu:memory-region)
           /escc-legacy[0] (qemu:memory-region)
    -      /gpio (macio-gpio)
    -        /gpio[0] (qemu:memory-region)
           /ide[0] (macio-ide)
             /ide.0 (IDE)
             /pmac-ide[0] (qemu:memory-region)

Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-ppc@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20200609122339.937862-11-armbru@redhat.com>


  Commit: efa0559547e7e2c10dee16a78066176c1ea75e97
      
https://github.com/qemu/qemu/commit/efa0559547e7e2c10dee16a78066176c1ea75e97
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/pci-host/pnv_phb4_pec.c

  Log Message:
  -----------
  pnv/phb4: Delete unused "pnv-phb4-pec-stack" devices

The number of stacks is controlled by property "num-stacks".
pnv_pec_instance_init() creates the maximum supported number, because
the property has not been set then.  pnv_pec_realize() realizes only
the wanted number.  Works, although it can leave unrealized devices
hanging around in the QOM composition tree.  Affects machine powernv9.

Delete the unused devices by making pnv_pec_realize() unparent them.
Visible in "info qom-tree":

     /machine (powernv9-machine)
       /chip[0] (power9_v2.0-pnv-chip)
         [...]
         /pec[0] (pnv-phb4-pec)
           /stack[0] (pnv-phb4-pec-stack)
             [...]
    -      /stack[1] (pnv-phb4-pec-stack)
    -        /phb (pnv-phb4)
    -          /pcie-mmcfg-mmio[0] (qemu:memory-region)
    -          /root (pnv-phb4-root-port)
    -          /source (xive-source)
    -      /stack[2] (pnv-phb4-pec-stack)
    -        /phb (pnv-phb4)
    -          /pcie-mmcfg-mmio[0] (qemu:memory-region)
    -          /root (pnv-phb4-root-port)
    -          /source (xive-source)
           /xscom-pec-0.0-nest[0] (qemu:memory-region)
           /xscom-pec-0.0-pci[0] (qemu:memory-region)
         /pec[1] (pnv-phb4-pec)
           /stack[0] (pnv-phb4-pec-stack)
             [...]
           /stack[1] (pnv-phb4-pec-stack)
             [...]
    -      /stack[2] (pnv-phb4-pec-stack)
    -        /phb (pnv-phb4)
    -          /pcie-mmcfg-mmio[0] (qemu:memory-region)
    -          /root (pnv-phb4-root-port)
    -          /source (xive-source)
           /xscom-pec-0.1-nest[0] (qemu:memory-region)
           /xscom-pec-0.1-pci[0] (qemu:memory-region)
         /pec[2] (pnv-phb4-pec)
           /stack[0] (pnv-phb4-pec-stack)
             [...]
           /stack[1] (pnv-phb4-pec-stack)
             [...]
           /stack[2] (pnv-phb4-pec-stack)
             [...]

Cc: Cédric Le Goater <clg@kaod.org>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-ppc@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20200609122339.937862-12-armbru@redhat.com>


  Commit: 157ed954e2dc8c2a4230d38058ca7f1fe50902e0
      
https://github.com/qemu/qemu/commit/157ed954e2dc8c2a4230d38058ca7f1fe50902e0
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: Make section PowerNV cover pci-host/pnv* as well

Cc: Cédric Le Goater <clg@kaod.org>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-ppc@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20200609122339.937862-13-armbru@redhat.com>


  Commit: b15fe4a018a019707793c178cba05ee5600389f6
      
https://github.com/qemu/qemu/commit/b15fe4a018a019707793c178cba05ee5600389f6
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/ppc/ppc440_uc.c

  Log Message:
  -----------
  ppc4xx: Drop redundant device realization

object_property_set_bool(OBJECT(dev), true, "realized", ...) right
after qdev_init_nofail(dev) does nothing, because qdev_init_nofail()
already realizes.  Drop.

Cc: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20200609122339.937862-14-armbru@redhat.com>


  Commit: 514db7710bf59c2c6d3c5046f5b52e54829fcbc0
      
https://github.com/qemu/qemu/commit/514db7710bf59c2c6d3c5046f5b52e54829fcbc0
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/misc/macio/macio.c

  Log Message:
  -----------
  macio: Put "macio-nvram" device on the macio bus

macio_oldworld_init() creates a "macio-nvram", sysbus device, but
neglects to but it on a bus.

Put it on the macio bus.  Affects machine g3beige.  Visible in "info
qtree":

             bus: macio.0
               type macio-bus
               [...]
    +          dev: macio-nvram, id ""
    +            size = 8192 (0x2000)
    +            it_shift = 4 (0x4)

This also makes it a QOM child of macio-oldworld.  Visible in "info
qom-tree":

     /machine (g3beige-machine)
       [...]
       /unattached (container)
         [...]
         /device[6] (macio-oldworld)
           [...]
    -    /device[7] (macio-nvram)
    -      /macio-nvram[0] (qemu:memory-region)
    +      /nvram (macio-nvram)
    +        /macio-nvram[0] (qemu:memory-region)
         [rest of device[*] renumbered...]

Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-ppc@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200609122339.937862-15-armbru@redhat.com>


  Commit: 6741a3430b59cfbdb97a2194dcc16a4fedce486d
      
https://github.com/qemu/qemu/commit/6741a3430b59cfbdb97a2194dcc16a4fedce486d
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/misc/macio/macio.c

  Log Message:
  -----------
  macio: Fix macio-bus to be a subtype of System bus

The devices we plug into the macio-bus are all sysbus devices
(DeviceClass member bus_type is TYPE_SYSTEM_BUS), but macio-bus does
not derive from TYPE_SYSTEM_BUS.  Fix that.

"info qtree" now shows the devices' mmio ranges, as it should

Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-ppc@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200609122339.937862-16-armbru@redhat.com>


  Commit: 9354eaaf16fdb98651574f131ff66ad974e50bba
      
https://github.com/qemu/qemu/commit/9354eaaf16fdb98651574f131ff66ad974e50bba
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/ppc/pnv.c

  Log Message:
  -----------
  ppc/pnv: Put "*-pnv-chip" and "pnv-xive" on the main system bus

pnv_init() creates "power10_v1.0-pnv-chip", "power8_v2.0-pnv-chip",
"power8e_v2.1-pnv-chip", "power8nvl_v1.0-pnv-chip", or
"power9_v2.0-pnv-chip" sysbus devices in a way that leaves them
unplugged.

pnv_chip_power9_instance_init() creates a "pnv-xive" sysbus device in
a way that leaves it unplugged.

Create them the common way that puts them into the main system bus.
Affects machines powernv8, powernv9, and powernv10.  Visible in "info
qtree".  Here's the change for powernv9:

     bus: main-system-bus
       type System
    +  dev: power9_v2.0-pnv-chip, id ""
    +    chip-id = 0 (0x0)
    +    ram-start = 0 (0x0)
    +    ram-size = 1879048192 (0x70000000)
    +    nr-cores = 1 (0x1)
    +    cores-mask = 72057594037927935 (0xffffffffffffff)
    +    nr-threads = 1 (0x1)
    +    num-phbs = 6 (0x6)
    +    mmio 000603fc00000000/0000000400000000
    [...]
    +  dev: pnv-xive, id ""
    +    ic-bar = 1692157036462080 (0x6030203100000)
    +    vc-bar = 1689949371891712 (0x6010000000000)
    +    pc-bar = 1690499127705600 (0x6018000000000)
    +    tm-bar = 1692157036986368 (0x6030203180000)

Cc: "Cédric Le Goater" <clg@kaod.org>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-ppc@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20200609122339.937862-17-armbru@redhat.com>


  Commit: 2f35254aa0403ed527fc8ec379e5f7fdf2184e85
      
https://github.com/qemu/qemu/commit/2f35254aa0403ed527fc8ec379e5f7fdf2184e85
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/ppc/pnv_psi.c
    M include/hw/ppc/pnv_psi.h

  Log Message:
  -----------
  pnv/psi: Correct the pnv-psi* devices not to be sysbus devices

pnv_chip_power8_instance_init() creates a "pnv-psi-POWER8" sysbus
device in a way that leaves it unplugged.
pnv_chip_power9_instance_init() and pnv_chip_power10_instance_init()
do the same for "pnv-psi-POWER9" and "pnv-psi-POWER10", respectively.

These devices aren't actually sysbus devices.  Correct that.

Cc: "Cédric Le Goater" <clg@kaod.org>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-ppc@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20200609122339.937862-18-armbru@redhat.com>


  Commit: 734a5914333ea81e4809699a8539de63a66f0d4c
      
https://github.com/qemu/qemu/commit/734a5914333ea81e4809699a8539de63a66f0d4c
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/display/ati.c
    M hw/display/sm501.c

  Log Message:
  -----------
  display/sm501 display/ati: Fix to realize "i2c-ddc"

sm501_init() and ati_vga_realize() create an "i2c-ddc" device, but
neglect to realize it.  Affects machines sam460ex, shix, r2d, and
fulong2e.

In theory, a device becomes real only on realize.  In practice, the
transition from unreal to real is a fuzzy one.  The work to make a
device real can be spread between realize methods (fine),
instance_init methods (wrong), and board code wiring up the device
(fine as long as it effectively happens on realize).  Depending on
what exactly is done where, a device can work even when we neglect
to realize it.

This one appears to work.  Nevertheless, it's a clear misuse of the
interface.  Even when it works today (more or less by chance), it can
break tomorrow.

Fix by realizing it right away.  Visible in "info qom-tree"; here's
the change for sam460ex:

     /machine (sam460ex-machine)
       [...]
       /unattached (container)
         [...]
    -    /device[14] (sii3112)
    +    /device[14] (i2c-ddc)
    +    /device[15] (sii3112)
         [rest of device[*] renumbered...]

Fixes: 4a1f253adb45ac6019971193d5077c4d5d55886a
Fixes: c82c7336de58876862e6b4dccbda29e9240fd388
Cc: BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-ppc@nongnu.org
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
Cc: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Tested-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200609122339.937862-19-armbru@redhat.com>


  Commit: 75a6ed875ff0a2eb6b2971ae2098ed09963d7329
      
https://github.com/qemu/qemu/commit/75a6ed875ff0a2eb6b2971ae2098ed09963d7329
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/riscv/opentitan.c
    M hw/riscv/sifive_e.c
    M hw/riscv/sifive_u.c
    M hw/riscv/spike.c
    M hw/riscv/virt.c

  Log Message:
  -----------
  riscv: Fix to put "riscv.hart_array" devices on sysbus

riscv_sifive_e_soc_init(), riscv_sifive_u_soc_init(),
spike_board_init(), spike_v1_10_0_board_init(),
spike_v1_09_1_board_init(), and riscv_virt_board_init() create
"riscv-hart_array" sysbus devices in a way that leaves them unplugged.

Create them the common way that puts them into the main system bus.
Affects machines sifive_e, sifive_u, spike, spike_v1.10, spike_v1.9.1,
and virt.  Visible in "info qtree", here's the change for sifive_e:

     bus: main-system-bus
       type System
    +  dev: riscv.hart_array, id ""
    +    num-harts = 1 (0x1)
    +    hartid-base = 0 (0x0)
    +    cpu-type = "sifive-e31-riscv-cpu"
       dev: sifive_soc.gpio, id ""

Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Alistair Francis <Alistair.Francis@wdc.com>
Cc: Sagar Karandikar <sagark@eecs.berkeley.edu>
Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Cc: qemu-riscv@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20200609122339.937862-20-armbru@redhat.com>


  Commit: 589b1be07c060e583d9f758ff0cb10e0f1ff242f
      
https://github.com/qemu/qemu/commit/589b1be07c060e583d9f758ff0cb10e0f1ff242f
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M include/hw/riscv/sifive_e.h
    M include/hw/riscv/sifive_u.h

  Log Message:
  -----------
  riscv: Fix type of SiFive[EU]SocState, member parent_obj

Device "riscv.sifive.e.soc" is a direct subtype of TYPE_DEVICE, but
its instance struct SiFiveESoCState's member @parent_obj is
SysBusDevice instead of DeviceState.  Correct that.

Same for "riscv.sifive.u.soc"'s instance struct SiFiveUSoCState.

Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Alistair Francis <Alistair.Francis@wdc.com>
Cc: Sagar Karandikar <sagark@eecs.berkeley.edu>
Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Cc: qemu-riscv@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20200609122339.937862-21-armbru@redhat.com>


  Commit: d6b78ac8ecf94f56dbfbecc23fb4365d8772a41a
      
https://github.com/qemu/qemu/commit/d6b78ac8ecf94f56dbfbecc23fb4365d8772a41a
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/sparc/leon3.c

  Log Message:
  -----------
  sparc/leon3: Fix to put grlib,* devices on sysbus

leon3_generic_hw_init() creates a "grlib,ahbpnp" and a "grlib,apbpnp"
sysbus device in a way that leaves them unplugged.

Create them the common way that puts them into the main system bus.
Affects machine leon3_generic.  Visible in "info qtree":

     bus: main-system-bus
       type System
    +  dev: grlib,ahbpnp, id ""
    +    mmio 00000000fffff000/0000000000001000
    +  dev: grlib,apbpnp, id ""
    +    mmio 00000000800ff000/0000000000001000
       dev: grlib,irqmp, id ""

Cc: Fabien Chouteau <chouteau@adacore.com>
Cc: KONRAD Frederic <frederic.konrad@adacore.com>
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: KONRAD Frederic <frederic.konrad@adacore.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200609122339.937862-22-armbru@redhat.com>
Acked-by: Artyom Tarasenko <atar4qemu@gmail.com>


  Commit: 81cb05732efb36971901c515b007869cc1d3a532
      
https://github.com/qemu/qemu/commit/81cb05732efb36971901c515b007869cc1d3a532
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/core/qdev.c

  Log Message:
  -----------
  qdev: Assert devices are plugged into a bus that can take them

This would have caught some of the bugs I just fixed.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20200609122339.937862-23-armbru@redhat.com>


  Commit: 007d1dbf72536ec1b847a944832e4de1546af2ac
      
https://github.com/qemu/qemu/commit/007d1dbf72536ec1b847a944832e4de1546af2ac
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/sd/sd.c

  Log Message:
  -----------
  sd: Hide the qdev-but-not-quite thing created by sd_init()

Commit 260bc9d8aa "hw/sd/sd.c: QOMify" QOMified only the device
itself, not its users.  It kept sd_init() around for non-QOMified
users.

More than four years later, three such users remain: omap1 (machines
cheetah, sx1, sx1-v1) and omap2 (machines n800, n810) are not
QOMified, and pl181 (machines integratorcp, realview-eb,
realview-eb-mpcore, realview-pb-a8 realview-pbx-a9, versatileab,
versatilepb, vexpress-a15, vexpress-a9) is not QOMified properly.

The issue I presently have with this: an "sd-card" device should plug
into an "sd-bus" (its DeviceClass member bus_type says so), but
sd_init() leaves it unplugged.  This is normally a bug (I just fixed
some instances), and I'd like to assert proper pluggedness to prevent
regressions.  However, the qdev-but-not-quite thing returned by
sd_init() would fail the assertion.  Meh.

Make sd_init() hide it from QOM/qdev.  Visible in "info qom-tree",
here's the change for cheetah:

     /machine (cheetah-machine)
       [...]
       /unattached (container)
         [...]
         /device[5] (serial-mm)
           /serial (serial)
           /serial[0] (qemu:memory-region)
    -    /device[6] (sd-card)
    -    /device[7] (omap-gpio)
    +    /device[6] (omap-gpio)
         [rest of device[*] renumbered...]

Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200609122339.937862-24-armbru@redhat.com>


  Commit: dfe8c79c44680e34eac2e8abd0d0c885ce01aa55
      
https://github.com/qemu/qemu/commit/dfe8c79c44680e34eac2e8abd0d0c885ce01aa55
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/core/qdev.c

  Log Message:
  -----------
  qdev: Assert onboard devices all get realized properly

This would have caught some of the bugs I just fixed.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200609122339.937862-25-armbru@redhat.com>


  Commit: 30884d1b837fb09f9dba3a770325e228ec2335b4
      
https://github.com/qemu/qemu/commit/30884d1b837fb09f9dba3a770325e228ec2335b4
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/core/bus.c

  Log Message:
  -----------
  qdev: Rename qbus_realize() to qbus_init()

qbus_realize() does not actually realize.  Rename it to qbus_init().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-2-armbru@redhat.com>


  Commit: 9e1b990c2ee6e1b14f9abdf5ab325ff2cf9d8bd5
      
https://github.com/qemu/qemu/commit/9e1b990c2ee6e1b14f9abdf5ab325ff2cf9d8bd5
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/pci-host/prep.c

  Log Message:
  -----------
  Revert "hw/prep: realize the PCI root bus as part of the prep init"

This reverts commit 685f9a3428f625f580af0123aa95f4838d86cac3.

Realizing a device automatically realizes its buses, in
device_set_realized().  Realizing them in realize methods is
redundant, unless the methods themselves require them to be realized
early.  raven_pcihost_realizefn() doesn't.  Drop the redundant bus
realization.

Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-3-armbru@redhat.com>


  Commit: da9630c57ee386f8beb571ba6bb4a98d546c42ca
      
https://github.com/qemu/qemu/commit/da9630c57ee386f8beb571ba6bb4a98d546c42ca
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/pci-host/versatile.c

  Log Message:
  -----------
  Revert "hw/versatile: realize the PCI root bus as part of the versatile init"

This reverts commit b1af7959a66610669e1a019b9a84f6ed3a7936c6.

Realizing a device automatically realizes its buses, in
device_set_realized().  Realizing them in realize methods is
redundant, unless the methods themselves require them to be realized
early.  pci_vpb_realize() doesn't.  Drop the redundant bus
realization.

Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-4-armbru@redhat.com>


  Commit: 9940b2cfbc05cdffdf6b42227a80cb1e6d2a85c2
      
https://github.com/qemu/qemu/commit/9940b2cfbc05cdffdf6b42227a80cb1e6d2a85c2
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/core/bus.c
    M hw/core/qdev.c
    M include/hw/qdev-core.h

  Log Message:
  -----------
  qdev: New qdev_new(), qdev_realize(), etc.

We commonly plug devices into their bus right when we create them,
like this:

    dev = qdev_create(bus, type_name);

Note that @dev is a weak reference.  The reference from @bus to @dev
is the only strong one.

We realize at some later time, either with

    object_property_set_bool(OBJECT(dev), true, "realized", errp);

or its convenience wrapper

    qdev_init_nofail(dev);

If @dev still has no QOM parent then, realizing makes the
/machine/unattached/ orphanage its QOM parent.

Note that the device returned by qdev_create() is plugged into a bus,
but doesn't have a QOM parent, yet.  Until it acquires one,
unrealizing the bus will hang in bus_unparent():

    while ((kid = QTAILQ_FIRST(&bus->children)) != NULL) {
        DeviceState *dev = kid->child;
        object_unparent(OBJECT(dev));
    }

object_unparent() does nothing when its argument has no QOM parent,
and the loop spins forever.

Device state "no QOM parent, but plugged into bus" is dangerous.

Paolo suggested to delay plugging into the bus until realize.  We need
to plug into the parent bus before we call the device's realize
method, in case it uses the parent bus.  So the dangerous state still
exists, but only within realization, where we can manage it safely.

This commit creates infrastructure to do this:

    dev = qdev_new(type_name);
    ...
    qdev_realize_and_unref(dev, bus, errp)

Note that @dev becomes a strong reference here.
qdev_realize_and_unref() drops it.  There is also plain
qdev_realize(), which doesn't drop it.

The remainder of this series will convert all users to this new
interface.

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>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-5-armbru@redhat.com>


  Commit: 4e3a6778b0db1798afd696759cee28575f598ca8
      
https://github.com/qemu/qemu/commit/4e3a6778b0db1798afd696759cee28575f598ca8
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/block/nand.c
    M hw/misc/auxbus.c
    M qdev-monitor.c

  Log Message:
  -----------
  qdev: Put qdev_new() to use with Coccinelle

Let's start simple and put qdev_new() to use.  Coccinelle script:

    @ depends on !(file in "hw/core/qdev.c")@
    expression type_name;
    @@
    -    DEVICE(object_new(type_name))
    +    qdev_new(type_name)

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-6-armbru@redhat.com>


  Commit: f1483b466d7b607d45606a4287fea79380b7900d
      
https://github.com/qemu/qemu/commit/f1483b466d7b607d45606a4287fea79380b7900d
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/core/qdev.c
    M hw/pci/pci.c

  Log Message:
  -----------
  qdev: Convert to qbus_realize(), qbus_unrealize()

I'm going to convert device realization to qdev_realize() with the
help of Coccinelle.  Convert bus realization to qbus_realize() first,
to get it out of Coccinelle's way.  Readability improves.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-7-armbru@redhat.com>


  Commit: 981c3dcd948907f1127bc1d85b6e455dce687096
      
https://github.com/qemu/qemu/commit/981c3dcd948907f1127bc1d85b6e455dce687096
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/acpi/pcihp.c
    M hw/char/serial-pci-multi.c
    M hw/char/serial-pci.c
    M hw/core/bus.c
    M hw/i386/pc.c
    M hw/pci/pcie.c
    M hw/pci/shpc.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_pci.c
    M hw/s390x/css-bridge.c
    M hw/s390x/s390-pci-bus.c

  Log Message:
  -----------
  qdev: Convert to qdev_unrealize() with Coccinelle

For readability, and consistency with qbus_realize().

Coccinelle script:

    @ depends on !(file in "hw/core/qdev.c")@
    typedef DeviceState;
    DeviceState *dev;
    symbol false, error_abort;
    @@
    -    object_property_set_bool(OBJECT(dev), false, "realized", &error_abort);
    +    qdev_unrealize(dev);

    @ depends on !(file in "hw/core/qdev.c") && !(file in "hw/core/bus.c")@
    expression dev;
    symbol false, error_abort;
    @@
    -    object_property_set_bool(OBJECT(dev), false, "realized", &error_abort);
    +    qdev_unrealize(DEVICE(dev));

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-8-armbru@redhat.com>


  Commit: dc3edf8d8a544dbf21e1cb63339e42806470d5d9
      
https://github.com/qemu/qemu/commit/dc3edf8d8a544dbf21e1cb63339e42806470d5d9
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/core/qdev.c
    M include/hw/qdev-core.h

  Log Message:
  -----------
  qdev: Convert to qdev_unrealize() manually

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-9-armbru@redhat.com>


  Commit: 3e80f6902c13f6edb6675c0f33edcbbf0163ec32
      
https://github.com/qemu/qemu/commit/3e80f6902c13f6edb6675c0f33edcbbf0163ec32
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/alpha/typhoon.c
    M hw/arm/aspeed.c
    M hw/arm/cubieboard.c
    M hw/arm/exynos4210.c
    M hw/arm/exynos4_boards.c
    M hw/arm/imx25_pdk.c
    M hw/arm/integratorcp.c
    M hw/arm/mcimx6ul-evk.c
    M hw/arm/mcimx7d-sabre.c
    M hw/arm/mps2-tz.c
    M hw/arm/msf2-som.c
    M hw/arm/musicpal.c
    M hw/arm/netduino2.c
    M hw/arm/netduinoplus2.c
    M hw/arm/nseries.c
    M hw/arm/omap1.c
    M hw/arm/omap2.c
    M hw/arm/orangepi.c
    M hw/arm/pxa2xx.c
    M hw/arm/pxa2xx_gpio.c
    M hw/arm/pxa2xx_pic.c
    M hw/arm/raspi.c
    M hw/arm/realview.c
    M hw/arm/sbsa-ref.c
    M hw/arm/spitz.c
    M hw/arm/stellaris.c
    M hw/arm/strongarm.c
    M hw/arm/versatilepb.c
    M hw/arm/vexpress.c
    M hw/arm/virt.c
    M hw/arm/xilinx_zynq.c
    M hw/arm/xlnx-versal-virt.c
    M hw/arm/xlnx-versal.c
    M hw/arm/xlnx-zcu102.c
    M hw/audio/intel-hda.c
    M hw/block/fdc.c
    M hw/block/pflash_cfi01.c
    M hw/block/pflash_cfi02.c
    M hw/char/exynos4210_uart.c
    M hw/char/mcf_uart.c
    M hw/char/spapr_vty.c
    M hw/core/sysbus.c
    M hw/cris/axis_dev88.c
    M hw/display/milkymist-tmu2.c
    M hw/display/sm501.c
    M hw/dma/pxa2xx_dma.c
    M hw/dma/rc4030.c
    M hw/dma/sparc32_dma.c
    M hw/hppa/dino.c
    M hw/hppa/lasi.c
    M hw/hppa/machine.c
    M hw/i2c/core.c
    M hw/i2c/smbus_eeprom.c
    M hw/i386/pc_q35.c
    M hw/i386/x86.c
    M hw/ide/qdev.c
    M hw/intc/exynos4210_gic.c
    M hw/intc/s390_flic.c
    M hw/isa/isa-bus.c
    M hw/lm32/lm32.h
    M hw/lm32/milkymist-hw.h
    M hw/m68k/mcf5208.c
    M hw/m68k/mcf_intc.c
    M hw/m68k/next-cube.c
    M hw/m68k/q800.c
    M hw/microblaze/petalogix_ml605_mmu.c
    M hw/microblaze/petalogix_s3adsp1800_mmu.c
    M hw/mips/boston.c
    M hw/mips/gt64xxx_pci.c
    M hw/mips/jazz.c
    M hw/mips/malta.c
    M hw/mips/mipssim.c
    M hw/misc/empty_slot.c
    M hw/net/etraxfs_eth.c
    M hw/net/fsl_etsec/etsec.c
    M hw/net/lan9118.c
    M hw/net/lasi_i82596.c
    M hw/net/smc91c111.c
    M hw/net/spapr_llan.c
    M hw/nios2/10m50_devboard.c
    M hw/nvram/fw_cfg.c
    M hw/openrisc/openrisc_sim.c
    M hw/pci-bridge/pci_expander_bridge.c
    M hw/pci-host/bonito.c
    M hw/pci-host/i440fx.c
    M hw/pcmcia/pxa2xx.c
    M hw/ppc/e500.c
    M hw/ppc/mac_newworld.c
    M hw/ppc/mac_oldworld.c
    M hw/ppc/pnv.c
    M hw/ppc/ppc440_uc.c
    M hw/ppc/prep.c
    M hw/ppc/sam460ex.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_irq.c
    M hw/ppc/spapr_vio.c
    M hw/ppc/virtex_ml507.c
    M hw/riscv/sifive_clint.c
    M hw/riscv/sifive_e_prci.c
    M hw/riscv/sifive_plic.c
    M hw/riscv/sifive_test.c
    M hw/riscv/virt.c
    M hw/rtc/m48t59.c
    M hw/rtc/sun4v-rtc.c
    M hw/s390x/ap-bridge.c
    M hw/s390x/css-bridge.c
    M hw/s390x/s390-virtio-ccw.c
    M hw/scsi/scsi-bus.c
    M hw/scsi/spapr_vscsi.c
    M hw/sd/milkymist-memcard.c
    M hw/sd/pxa2xx_mmci.c
    M hw/sd/ssi-sd.c
    M hw/sh4/r2d.c
    M hw/sparc/leon3.c
    M hw/sparc/sun4m.c
    M hw/sparc64/sun4u.c
    M hw/xen/xen-bus.c
    M hw/xen/xen-legacy-backend.c
    M hw/xtensa/virt.c
    M hw/xtensa/xtfpga.c
    M include/hw/char/cadence_uart.h
    M include/hw/char/cmsdk-apb-uart.h
    M include/hw/char/pl011.h
    M include/hw/char/xilinx_uartlite.h
    M include/hw/cris/etraxfs.h
    M include/hw/misc/unimp.h
    M include/hw/timer/cmsdk-apb-timer.h

  Log Message:
  -----------
  qdev: Convert uses of qdev_create() with Coccinelle

This is the transformation explained in the commit before previous.
Takes care of just one pattern that needs conversion.  More to come in
this series.

Coccinelle script:

    @ depends on !(file in "hw/arm/highbank.c")@
    expression bus, type_name, dev, expr;
    @@
    -    dev = qdev_create(bus, type_name);
    +    dev = qdev_new(type_name);
         ... when != dev = expr
    -    qdev_init_nofail(dev);
    +    qdev_realize_and_unref(dev, bus, &error_fatal);

    @@
    expression bus, type_name, dev, expr;
    identifier DOWN;
    @@
    -    dev = DOWN(qdev_create(bus, type_name));
    +    dev = DOWN(qdev_new(type_name));
         ... when != dev = expr
    -    qdev_init_nofail(DEVICE(dev));
    +    qdev_realize_and_unref(DEVICE(dev), bus, &error_fatal);

    @@
    expression bus, type_name, expr;
    identifier dev;
    @@
    -    DeviceState *dev = qdev_create(bus, type_name);
    +    DeviceState *dev = qdev_new(type_name);
         ... when != dev = expr
    -    qdev_init_nofail(dev);
    +    qdev_realize_and_unref(dev, bus, &error_fatal);

    @@
    expression bus, type_name, dev, expr, errp;
    symbol true;
    @@
    -    dev = qdev_create(bus, type_name);
    +    dev = qdev_new(type_name);
         ... when != dev = expr
    -    object_property_set_bool(OBJECT(dev), true, "realized", errp);
    +    qdev_realize_and_unref(dev, bus, errp);

    @@
    expression bus, type_name, expr, errp;
    identifier dev;
    symbol true;
    @@
    -    DeviceState *dev = qdev_create(bus, type_name);
    +    DeviceState *dev = qdev_new(type_name);
         ... when != dev = expr
    -    object_property_set_bool(OBJECT(dev), true, "realized", errp);
    +    qdev_realize_and_unref(dev, bus, errp);

The first rule exempts hw/arm/highbank.c, because it matches along two
control flow paths there, with different @type_name.  Covered by the
next commit's manual conversions.

Missing #include "qapi/error.h" added manually.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-10-armbru@redhat.com>
[Conflicts in hw/misc/empty_slot.c and hw/sparc/leon3.c resolved]


  Commit: df70796916ebbafe262a01c1c4dc6d7af805de24
      
https://github.com/qemu/qemu/commit/df70796916ebbafe262a01c1c4dc6d7af805de24
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/arm/highbank.c
    M hw/arm/sbsa-ref.c
    M hw/arm/virt.c
    M hw/block/xen-block.c
    M hw/char/serial.c
    M hw/display/ati.c
    M hw/display/sm501.c
    M hw/display/xlnx_dp.c
    M hw/i386/pc.c
    M hw/i386/pc_sysfw.c
    M hw/pci-bridge/pci_expander_bridge.c
    M hw/ppc/pnv.c
    M hw/riscv/virt.c
    M hw/s390x/s390-pci-bus.c
    M hw/sparc/leon3.c
    M hw/usb/bus.c

  Log Message:
  -----------
  qdev: Convert uses of qdev_create() manually

Same transformation as in the previous commit.  Manual, because
convincing Coccinelle to transform these cases is somewhere between
not worthwhile and infeasible (at least for me).

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-11-armbru@redhat.com>


  Commit: 99ba777e53ebf31bf24e7a52a21fccdd25f95537
      
https://github.com/qemu/qemu/commit/99ba777e53ebf31bf24e7a52a21fccdd25f95537
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/display/virtio-gpu-pci.c
    M hw/display/virtio-vga.c
    M hw/i386/amd_iommu.c
    M hw/isa/piix4.c
    M hw/misc/macio/macio.c
    M hw/pci-host/designware.c
    M hw/pci-host/gpex.c
    M hw/pci-host/pnv_phb3.c
    M hw/pci-host/pnv_phb4.c
    M hw/pci-host/q35.c
    M hw/pci-host/versatile.c
    M hw/pci-host/xilinx-pcie.c
    M hw/s390x/vhost-vsock-ccw.c
    M hw/s390x/virtio-ccw-9p.c
    M hw/s390x/virtio-ccw-balloon.c
    M hw/s390x/virtio-ccw-blk.c
    M hw/s390x/virtio-ccw-crypto.c
    M hw/s390x/virtio-ccw-gpu.c
    M hw/s390x/virtio-ccw-input.c
    M hw/s390x/virtio-ccw-net.c
    M hw/s390x/virtio-ccw-rng.c
    M hw/s390x/virtio-ccw-scsi.c
    M hw/s390x/virtio-ccw-serial.c
    M hw/virtio/vhost-scsi-pci.c
    M hw/virtio/vhost-user-blk-pci.c
    M hw/virtio/vhost-user-fs-pci.c
    M hw/virtio/vhost-user-scsi-pci.c
    M hw/virtio/vhost-user-vsock-pci.c
    M hw/virtio/vhost-vsock-pci.c
    M hw/virtio/virtio-9p-pci.c
    M hw/virtio/virtio-balloon-pci.c
    M hw/virtio/virtio-blk-pci.c
    M hw/virtio/virtio-crypto-pci.c
    M hw/virtio/virtio-input-pci.c
    M hw/virtio/virtio-iommu-pci.c
    M hw/virtio/virtio-net-pci.c
    M hw/virtio/virtio-pmem-pci.c
    M hw/virtio/virtio-rng-pci.c
    M hw/virtio/virtio-scsi-pci.c
    M hw/virtio/virtio-serial-pci.c
    M hw/xen/xen-legacy-backend.c

  Log Message:
  -----------
  qdev: Convert uses of qdev_set_parent_bus() with Coccinelle

In addition to the qdev_create() patterns converted so far, we have a
qdev_set_parent_bus() pattern.  Mostly when we embed a device in a
parent device rather than allocating it on the heap.

This pattern also puts devices in the dangerous "no QOM parent, but
plugged into bus" state I explained in recent commit "qdev: New
qdev_new(), qdev_realize(), etc."

Apply same solution: convert to qdev_realize().  Coccinelle script:

    @@
    expression dev, bus, errp;
    symbol true;
    @@
    -    qdev_set_parent_bus(DEVICE(dev), bus);
         ...
    -    object_property_set_bool(OBJECT(dev), true, "realized", errp);
    +    qdev_realize(DEVICE(dev), bus, errp);

    @ depends on !(file in "qdev-monitor.c") && !(file in "hw/core/qdev.c")@
    expression dev, bus, errp;
    symbol true;
    @@
    -    qdev_set_parent_bus(dev, bus);
         ...
    -    object_property_set_bool(OBJECT(dev), true, "realized", errp);
    +    qdev_realize(dev, bus, errp);

    @@
    expression dev, bus;
    symbol true;
    @@
    -    qdev_set_parent_bus(DEVICE(dev), bus);
         ...
    -    qdev_init_nofail(DEVICE(dev));
    +    qdev_realize(DEVICE(dev), bus, &error_fatal);

Unconverted uses of qdev_set_parent_bus() remain.  They'll be
converted later in this series.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-12-armbru@redhat.com>
[Also convert new hw/virtio/vhost-user-vsock-pci.c]


  Commit: 68424112284f1553e886f3db7ddada7d8ddcbb6a
      
https://github.com/qemu/qemu/commit/68424112284f1553e886f3db7ddada7d8ddcbb6a
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/pci-host/prep.c
    M hw/ppc/pnv.c
    M hw/s390x/sclp.c

  Log Message:
  -----------
  qdev: Convert uses of qdev_set_parent_bus() manually

Same transformation as in the previous commit.  Manual, because
convincing Coccinelle to transform these cases is somewhere between
not worthwhile and infeasible (at least for me).

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-13-armbru@redhat.com>


  Commit: 7411aa63a5f586329f87cbf318addaef427aa906
      
https://github.com/qemu/qemu/commit/7411aa63a5f586329f87cbf318addaef427aa906
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/pci/pci.c
    M include/hw/pci/pci.h

  Log Message:
  -----------
  pci: New pci_new(), pci_realize_and_unref() etc.

I'm converting from qdev_create()/qdev_init_nofail() to
qdev_new()/qdev_realize_and_unref(); recent commit "qdev: New
qdev_new(), qdev_realize(), etc." explains why.

PCI devices use qdev_create() through pci_create() and
pci_create_multifunction().

Provide pci_new(), pci_new_multifunction(), and
pci_realize_and_unref() for converting PCI devices.

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-14-armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 7d61226158b58f84b832390b13a72d3902f56696
      
https://github.com/qemu/qemu/commit/7d61226158b58f84b832390b13a72d3902f56696
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/ppc/mac_newworld.c
    M hw/ppc/mac_oldworld.c

  Log Message:
  -----------
  hw/ppc: Eliminate two superfluous QOM casts

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-15-armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 9307d06da9d12ede17942dc4f1c7bf8d80b4a3c6
      
https://github.com/qemu/qemu/commit/9307d06da9d12ede17942dc4f1c7bf8d80b4a3c6
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/acpi/piix4.c
    M hw/i386/pc_q35.c
    M hw/isa/vt82c686.c
    M hw/mips/fuloong2e.c
    M hw/pci-bridge/dec.c
    M hw/pci-host/bonito.c
    M hw/pci-host/sabre.c
    M hw/pci/pci.c
    M hw/ppc/mac_newworld.c
    M hw/ppc/mac_oldworld.c
    M hw/sparc64/sun4u.c

  Log Message:
  -----------
  pci: Convert uses of pci_create() etc. with Coccinelle

Replace

    dev = pci_create(bus, type_name);
    ...
    qdev_init_nofail(dev);

by

    dev = pci_new(type_name);
    ...
    pci_realize_and_unref(dev, bus, &error_fatal);

and similarly for pci_create_multifunction().

Recent commit "qdev: New qdev_new(), qdev_realize(), etc." explains
why.

Coccinelle script:

    @@
    expression dev, bus, expr;
    expression list args;
    @@
    -    dev = pci_create(bus, args);
    +    dev = pci_new(args);
         ... when != dev = expr
    -    qdev_init_nofail(&dev->qdev);
    +    pci_realize_and_unref(dev, bus, &error_fatal);

    @@
    expression dev, bus, expr;
    expression list args;
    expression d;
    @@
    -    dev = pci_create(bus, args);
    +    dev = pci_new(args);
    (
         d = &dev->qdev;
    |
         d = DEVICE(dev);
    )
         ... when != dev = expr
    -    qdev_init_nofail(d);
    +    pci_realize_and_unref(dev, bus, &error_fatal);

    @@
    expression dev, bus, expr;
    expression list args;
    @@
    -    dev = pci_create(bus, args);
    +    dev = pci_new(args);
         ... when != dev = expr
    -    qdev_init_nofail(DEVICE(dev));
    +    pci_realize_and_unref(dev, bus, &error_fatal);

    @@
    expression dev, bus, expr;
    expression list args;
    @@
    -    dev = DEVICE(pci_create(bus, args));
    +    PCIDevice *pci_dev; // TODO move
    +    pci_dev = pci_new(args);
    +    dev = DEVICE(pci_dev);
         ... when != dev = expr
    -    qdev_init_nofail(dev);
    +    pci_realize_and_unref(pci_dev, bus, &error_fatal);

    @@
    expression dev, bus, expr;
    expression list args;
    @@
    -    dev = pci_create_multifunction(bus, args);
    +    dev = pci_new_multifunction(args);
         ... when != dev = expr
    -    qdev_init_nofail(&dev->qdev);
    +    pci_realize_and_unref(dev, bus, &error_fatal);

    @@
    expression bus, expr;
    expression list args;
    identifier dev;
    @@
    -    PCIDevice *dev = pci_create_multifunction(bus, args);
    +    PCIDevice *dev = pci_new_multifunction(args);
         ... when != dev = expr
    -    qdev_init_nofail(&dev->qdev);
    +    pci_realize_and_unref(dev, bus, &error_fatal);

    @@
    expression dev, bus, expr;
    expression list args;
    @@
    -    dev = pci_create_multifunction(bus, args);
    +    dev = pci_new_multifunction(args);
         ... when != dev = expr
    -    qdev_init_nofail(DEVICE(dev));
    +    pci_realize_and_unref(dev, bus, &error_fatal);

Missing #include "qapi/error.h" added manually, whitespace changes
minimized manually, @pci_dev declarations moved manually.

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-16-armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: db2322469a245eb9d9aa1c98747f6d595cca8f35
      
https://github.com/qemu/qemu/commit/db2322469a245eb9d9aa1c98747f6d595cca8f35
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/sparc64/sun4u.c

  Log Message:
  -----------
  pci: Convert uses of pci_create() etc. manually

Same transformation as in the previous commit.  Manual, because
convincing Coccinelle to transform these cases is not worthwhile.

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-17-armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: a9cf5c46c6a6fd965cf12ddb37f44d25e914bf04
      
https://github.com/qemu/qemu/commit/a9cf5c46c6a6fd965cf12ddb37f44d25e914bf04
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/pci/pci.c
    M include/hw/pci/pci.h

  Log Message:
  -----------
  pci: pci_create(), pci_create_multifunction() are now unused, drop

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-18-armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 0fe9d9011971820b2dab27aa49cfb957b91cc3e2
      
https://github.com/qemu/qemu/commit/0fe9d9011971820b2dab27aa49cfb957b91cc3e2
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/isa/isa-bus.c
    M include/hw/isa/isa.h

  Log Message:
  -----------
  isa: New isa_new(), isa_realize_and_unref() etc.

I'm converting from qdev_create()/qdev_init_nofail() to
qdev_new()/qdev_realize_and_unref(); recent commit "qdev: New
qdev_new(), qdev_realize(), etc." explains why.

ISA devices use qdev_create() through isa_create() and
isa_try_create().

Provide isa_new(), isa_try_new(), and isa_realize_and_unref() for
converting ISA devices.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-19-armbru@redhat.com>


  Commit: 96927c744f9cd5205f95ef897c35695038dc2896
      
https://github.com/qemu/qemu/commit/96927c744f9cd5205f95ef897c35695038dc2896
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/char/parallel-isa.c
    M hw/char/serial-isa.c
    M hw/dma/i8257.c
    M hw/ide/isa.c
    M hw/intc/i8259_common.c
    M hw/isa/isa-bus.c
    M hw/isa/isa-superio.c
    M hw/ppc/prep.c
    M hw/rtc/m48t59-isa.c
    M hw/rtc/mc146818rtc.c
    M hw/sparc64/sun4u.c
    M include/hw/audio/pcspk.h
    M include/hw/timer/i8254.h

  Log Message:
  -----------
  isa: Convert uses of isa_create() with Coccinelle

Replace

    dev = isa_create(bus, type_name);
    ...
    qdev_init_nofail(dev);

by

    dev = isa_new(type_name);
    ...
    isa_realize_and_unref(dev, bus, &error_fatal);

Recent commit "qdev: New qdev_new(), qdev_realize(), etc." explains
why.

Coccinelle script:

    @@
    expression dev, bus, expr;
    expression list args;
    expression d;
    @@
    -    dev = isa_create(bus, args);
    +    dev = isa_new(args);
    (
         d = &dev->qdev;
    |
         d = DEVICE(dev);
    )
         ... when != dev = expr
    -    qdev_init_nofail(d);
    +    isa_realize_and_unref(dev, bus, &error_fatal);

    @@
    expression dev, bus, expr;
    expression list args;
    @@
    -    dev = isa_create(bus, args);
    +    dev = isa_new(args);
         ... when != dev = expr
    -    qdev_init_nofail(DEVICE(dev));
    +    isa_realize_and_unref(dev, bus, &error_fatal);

    @@
    expression dev, bus, expr;
    expression list args;
    @@
    -    dev = DEVICE(isa_create(bus, args));
    +    ISADevice *isa_dev; // TODO move
    +    isa_dev = isa_new(args);
    +    dev = DEVICE(isa_dev);
         ... when != dev = expr
    -    qdev_init_nofail(dev);
    +    isa_realize_and_unref(isa_dev, bus, &error_fatal);

Missing #include "qapi/error.h" added manually, whitespace changes
minimized manually.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-20-armbru@redhat.com>


  Commit: c23e05614e54e11f54961fbf086193ccb4cf8aa5
      
https://github.com/qemu/qemu/commit/c23e05614e54e11f54961fbf086193ccb4cf8aa5
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/block/fdc.c
    M hw/i386/pc.c
    M hw/ppc/pnv.c
    M include/hw/net/ne2000-isa.h

  Log Message:
  -----------
  isa: Convert uses of isa_create(), isa_try_create() manually

Same transformation as in the previous commit.  Manual, because
convincing Coccinelle to transform these cases is not worthwhile.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-21-armbru@redhat.com>


  Commit: bd2f053dc5de7b28729a4a23e180de198d59159f
      
https://github.com/qemu/qemu/commit/bd2f053dc5de7b28729a4a23e180de198d59159f
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/isa/isa-bus.c
    M include/hw/isa/isa.h

  Log Message:
  -----------
  isa: isa_create(), isa_try_create() are now unused, drop

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-22-armbru@redhat.com>


  Commit: 7f16c76e83cedeea0e4cec8942c974885a216865
      
https://github.com/qemu/qemu/commit/7f16c76e83cedeea0e4cec8942c974885a216865
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/ssi/aspeed_smc.c
    M hw/ssi/imx_spi.c
    M hw/ssi/mss-spi.c
    M hw/ssi/ssi.c
    M hw/ssi/xilinx_spi.c
    M hw/ssi/xilinx_spips.c
    M include/hw/ssi/ssi.h

  Log Message:
  -----------
  ssi: ssi_auto_connect_slaves() never does anything, drop

ssi_auto_connect_slaves(parent, cs_line, bus) iterates over @parent's
QOM children @dev of type TYPE_SSI_SLAVE.  It puts these on @bus, and
sets cs_line[] to qdev_get_gpio_in_named(dev, SSI_GPIO_CS, 0).

Suspicious: there is no protection against overrunning cs_line[].

Turns out it's safe because ssi_auto_connect_slaves() never finds any
such children.  Its called by realize methods of some (but not all)
devices providing an SSI bus, and gets passed the device.

SSI slave devices are always created with ssi_create_slave_no_init(),
optionally via ssi_create_slave().  This adds them to their SSI bus.
It doesn't set their QOM parent.

ssi_create_slave_no_init() is always immediately followed by
qdev_init_nofail(), with no QOM parent assigned, so
device_set_realized() puts the device into the /machine/unattached/
orphanage.  None become QOM children of a device providing an SSI bus.

ssi_auto_connect_slaves() was added in commit b4ae3cfa57 "ssi: Add
slave autoconnect helper".  I can't see which slaves it was supposed
to connect back then.

Cc: Alistair Francis <alistair@alistair23.me>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-23-armbru@redhat.com>


  Commit: 57d479c9c6c69cd856f77360e116f25e73e40566
      
https://github.com/qemu/qemu/commit/57d479c9c6c69cd856f77360e116f25e73e40566
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/arm/aspeed.c
    M hw/arm/msf2-som.c
    M hw/arm/sabrelite.c
    M hw/arm/xilinx_zynq.c
    M hw/arm/xlnx-zcu102.c
    M hw/microblaze/petalogix_ml605_mmu.c

  Log Message:
  -----------
  ssi: Convert uses of ssi_create_slave_no_init() with Coccinelle

Replace

    dev = ssi_create_slave_no_init(bus, type_name);
    ...
    qdev_init_nofail(dev);

by

    dev = qdev_new(type_name);
    ...
    qdev_realize_and_unref(dev, bus, &error_fatal);

Recent commit "qdev: New qdev_new(), qdev_realize(), etc." explains
why.

    @@
    type SSIBus;
    identifier bus;
    expression dev, qbus, expr;
    expression list args;
    @@
    -    bus = (SSIBus *)qbus;
    +    bus = qbus; // TODO fix up decl
         ...
    -    dev = ssi_create_slave_no_init(bus, args);
    +    dev = qdev_new(args);
         ... when != dev = expr
    -    qdev_init_nofail(dev);
    +    qdev_realize_and_unref(dev, bus, &error_fatal);

    @@
    expression dev, bus, expr;
    expression list args;
    @@
    -    dev = ssi_create_slave_no_init(bus, args);
    +    dev = qdev_new(args);
         ... when != dev = expr
    -    qdev_init_nofail(dev);
    +    qdev_realize_and_unref(dev, BUS(bus), &error_fatal);

Bus declarations fixed up manually.

Cc: Alistair Francis <alistair@alistair23.me>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-24-armbru@redhat.com>


  Commit: 7e272a0001ab7a9f3d2e14e1829bc6f522440eca
      
https://github.com/qemu/qemu/commit/7e272a0001ab7a9f3d2e14e1829bc6f522440eca
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/ssi/ssi.c

  Log Message:
  -----------
  ssi: Convert last use of ssi_create_slave_no_init() manually

Same transformation as in the previous commit.  Manual, because
convincing Coccinelle to transform this case is not worthwhile.

Cc: Alistair Francis <alistair@alistair23.me>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-25-armbru@redhat.com>


  Commit: 7ce8d8c8d5b4d7492bd493d6f12b68e23c1d864d
      
https://github.com/qemu/qemu/commit/7ce8d8c8d5b4d7492bd493d6f12b68e23c1d864d
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/ssi/ssi.c
    M include/hw/ssi/ssi.h

  Log Message:
  -----------
  ssi: ssi_create_slave_no_init() is now unused, drop

Cc: Alistair Francis <alistair@alistair23.me>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-26-armbru@redhat.com>


  Commit: 32aaaebe5665a75f8be8d76ba3ecfcf87627858b
      
https://github.com/qemu/qemu/commit/32aaaebe5665a75f8be8d76ba3ecfcf87627858b
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/usb/bus.c
    M include/hw/usb.h

  Log Message:
  -----------
  usb: New usb_new(), usb_realize_and_unref()

I'm converting from qdev_create()/qdev_init_nofail() to
qdev_new()/qdev_realize_and_unref(); recent commit "qdev: New
qdev_new(), qdev_realize(), etc." explains why.

USB devices use qdev_create() through usb_create().

Provide usb_new() and usb_realize_and_unref() for converting USB
devices.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-27-armbru@redhat.com>


  Commit: 590ce74a08d5b4fb39ac165a4fb68bd07e6d2b6c
      
https://github.com/qemu/qemu/commit/590ce74a08d5b4fb39ac165a4fb68bd07e6d2b6c
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/usb/bus.c
    M hw/usb/dev-serial.c
    M include/hw/usb.h

  Log Message:
  -----------
  usb: Convert uses of usb_create()

Replace

    dev = usb_create(bus, type_name);
    ...
    object_property_set_bool(OBJECT(dev), true, "realized", &err);

by

    dev = isa_new(type_name);
    ...
    usb_realize_and_unref(dev, bus, &err);

Recent commit "qdev: New qdev_new(), qdev_realize(), etc." explains
why.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-28-armbru@redhat.com>


  Commit: 8cd81a9e551265dc63fe80aa83af773709e48552
      
https://github.com/qemu/qemu/commit/8cd81a9e551265dc63fe80aa83af773709e48552
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/usb/bus.c
    M include/hw/usb.h

  Log Message:
  -----------
  usb: usb_create() is now unused, drop

Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-29-armbru@redhat.com>


  Commit: 535770518f85e6e8b912c262492a251053491637
      
https://github.com/qemu/qemu/commit/535770518f85e6e8b912c262492a251053491637
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/usb/bus.c

  Log Message:
  -----------
  usb: Eliminate usb_try_create_simple()

usb_try_create_simple() is qdev_try_new() and qdev_realize_and_unref()
with more verbose error messages.  Of its two users, one ignores
errors, and the other asserts they are impossible.

Make them use qdev_try_new() and qdev_realize_and_unref() directly,
and eliminate usb_try_create_simple

Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-30-armbru@redhat.com>


  Commit: 2194abd6231b36704b77adfdec2a32d38b7dc848
      
https://github.com/qemu/qemu/commit/2194abd6231b36704b77adfdec2a32d38b7dc848
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/core/qdev.c
    M hw/core/sysbus.c
    M include/hw/qdev-core.h
    M migration/migration.c

  Log Message:
  -----------
  qdev: qdev_create(), qdev_try_create() are now unused, drop

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-31-armbru@redhat.com>


  Commit: dbe4070e59ab86f4a25de9cd12ed56f9eb68049b
      
https://github.com/qemu/qemu/commit/dbe4070e59ab86f4a25de9cd12ed56f9eb68049b
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/display/xlnx_dp.c
    M hw/misc/auxbus.c
    M include/hw/misc/auxbus.h

  Log Message:
  -----------
  auxbus: Rename aux_init_bus() to aux_bus_init()

Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-32-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>


  Commit: b7a1b5483ee0179f0e5d31cf43678fa225227614
      
https://github.com/qemu/qemu/commit/b7a1b5483ee0179f0e5d31cf43678fa225227614
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/display/xlnx_dp.c
    M hw/misc/auxbus.c
    M include/hw/misc/auxbus.h

  Log Message:
  -----------
  auxbus: New aux_bus_realize(), pairing with aux_bus_init()

aux_bus_init() encapsulates the creation of an aux-bus and its
aux-to-i2c-bridge device.

Create aux_bus_realize() to similarly encapsulate their realization.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-33-armbru@redhat.com>


  Commit: 2214985408041b54e7f25ce76cd8e6d9e68c4be1
      
https://github.com/qemu/qemu/commit/2214985408041b54e7f25ce76cd8e6d9e68c4be1
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/display/xlnx_dp.c
    M hw/misc/auxbus.c

  Log Message:
  -----------
  auxbus: Convert a use of qdev_set_parent_bus()

Convert qdev_set_parent_bus()/qdev_init_nofail() to qdev_realize();
recent commit "qdev: New qdev_new(), qdev_realize(), etc." explains
why.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-34-armbru@redhat.com>


  Commit: cd9ae806cdad8f1992e0ac9198c114c636693764
      
https://github.com/qemu/qemu/commit/cd9ae806cdad8f1992e0ac9198c114c636693764
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/display/xlnx_dp.c
    M hw/misc/auxbus.c
    M include/hw/misc/auxbus.h

  Log Message:
  -----------
  auxbus: Eliminate aux_create_slave()

aux_create_slave() has become a trivial wrapper around qdev_new().
There's just one user.  Eliminate.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-35-armbru@redhat.com>


  Commit: 19dc7e977c145cf3683dc5d18d54ef3629e34619
      
https://github.com/qemu/qemu/commit/19dc7e977c145cf3683dc5d18d54ef3629e34619
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/arm/aspeed.c
    M hw/microblaze/xlnx-zynqmp-pmu.c
    M hw/pci-host/pnv_phb4.c
    M hw/riscv/riscv_hart.c

  Log Message:
  -----------
  qom: Tidy up a few object_initialize_child() calls

The callers of object_initialize_child() commonly  pass either
&child, sizeof(child), or pchild, sizeof(*pchild).  Tidy up the few
that don't, mostly to keep the next commit simpler.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-36-armbru@redhat.com>


  Commit: 9fc7fc4d3909817555ce0af6bcb69dff1606140d
      
https://github.com/qemu/qemu/commit/9fc7fc4d3909817555ce0af6bcb69dff1606140d
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/arm/allwinner-a10.c
    M hw/arm/allwinner-h3.c
    M hw/arm/armsse.c
    M hw/arm/aspeed.c
    M hw/arm/aspeed_ast2600.c
    M hw/arm/aspeed_soc.c
    M hw/arm/bcm2836.c
    M hw/arm/digic.c
    M hw/arm/exynos4210.c
    M hw/arm/fsl-imx25.c
    M hw/arm/fsl-imx31.c
    M hw/arm/fsl-imx6.c
    M hw/arm/fsl-imx6ul.c
    M hw/arm/fsl-imx7.c
    M hw/arm/imx25_pdk.c
    M hw/arm/kzm.c
    M hw/arm/mps2-tz.c
    M hw/arm/musca.c
    M hw/arm/raspi.c
    M hw/arm/stm32f405_soc.c
    M hw/arm/xlnx-versal.c
    M hw/arm/xlnx-zcu102.c
    M hw/arm/xlnx-zynqmp.c
    M hw/char/serial-isa.c
    M hw/char/serial-pci-multi.c
    M hw/char/serial-pci.c
    M hw/char/serial.c
    M hw/core/sysbus.c
    M hw/dma/xilinx_axidma.c
    M hw/intc/pnv_xive.c
    M hw/intc/spapr_xive.c
    M hw/microblaze/xlnx-zynqmp-pmu.c
    M hw/misc/macio/macio.c
    M hw/net/xilinx_axienet.c
    M hw/pci-host/designware.c
    M hw/pci-host/gpex.c
    M hw/pci-host/pnv_phb3.c
    M hw/pci-host/pnv_phb4.c
    M hw/pci-host/pnv_phb4_pec.c
    M hw/pci-host/q35.c
    M hw/pci-host/xilinx-pcie.c
    M hw/ppc/pnv.c
    M hw/ppc/pnv_psi.c
    M hw/ppc/spapr.c
    M hw/riscv/opentitan.c
    M hw/riscv/riscv_hart.c
    M hw/riscv/sifive_e.c
    M hw/riscv/sifive_u.c
    M hw/virtio/virtio.c
    M include/qom/object.h
    M qom/object.c

  Log Message:
  -----------
  qom: Less verbose object_initialize_child()

All users of object_initialize_child() pass the obvious child size
argument.  Almost all pass &error_abort and no properties.  Tiresome.

Rename object_initialize_child() to
object_initialize_child_with_props() to free the name.  New
convenience wrapper object_initialize_child() automates the size
argument, and passes &error_abort and no properties.

Rename object_initialize_childv() to
object_initialize_child_with_propsv() for consistency.

Convert callers with this Coccinelle script:

    @@
    expression parent, propname, type;
    expression child, size;
    symbol error_abort;
    @@
    -    object_initialize_child(parent, propname, OBJECT(child), size, type, 
&error_abort, NULL)
    +    object_initialize_child(parent, propname, child, size, type, 
&error_abort, NULL)

    @@
    expression parent, propname, type;
    expression child;
    symbol error_abort;
    @@
    -    object_initialize_child(parent, propname, child, sizeof(*child), type, 
&error_abort, NULL)
    +    object_initialize_child(parent, propname, child, type)

    @@
    expression parent, propname, type;
    expression child;
    symbol error_abort;
    @@
    -    object_initialize_child(parent, propname, &child, sizeof(child), type, 
&error_abort, NULL)
    +    object_initialize_child(parent, propname, &child, type)

    @@
    expression parent, propname, type;
    expression child, size, err;
    expression list props;
    @@
    -    object_initialize_child(parent, propname, child, size, type, err, 
props)
    +    object_initialize_child_with_props(parent, propname, child, size, 
type, err, props)

Note that Coccinelle chokes on ARMSSE typedef vs. macro in
hw/arm/armsse.c.  Worked around by temporarily renaming the macro for
the spatch run.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
[Rebased: machine opentitan is new (commit fe0fe4735e7)]
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-37-armbru@redhat.com>


  Commit: f4a0df70a23946011c0e435d66530ff919e73b37
      
https://github.com/qemu/qemu/commit/f4a0df70a23946011c0e435d66530ff919e73b37
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/misc/macio/macio.c

  Log Message:
  -----------
  macio: Convert use of qdev_set_parent_bus()

Convert qdev_set_parent_bus()/realize to qdev_realize(); recent commit
"qdev: New qdev_new(), qdev_realize(), etc." explains why.

Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-38-armbru@redhat.com>


  Commit: 8fb9cfe762e6d5d6d9d2241dc4d25475ecd3e77d
      
https://github.com/qemu/qemu/commit/8fb9cfe762e6d5d6d9d2241dc4d25475ecd3e77d
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/misc/macio/macio.c

  Log Message:
  -----------
  macio: Eliminate macio_init_child_obj()

macio_init_child_obj() has become a trivial wrapper around
object_initialize_child_with_props().  Eliminate it, since the general
convenience wrapper object_initialize_child() is just as convenient
already.

Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-39-armbru@redhat.com>


  Commit: 9bdee7f4a5b45f0240c9296fe0daacb6c08f247c
      
https://github.com/qemu/qemu/commit/9bdee7f4a5b45f0240c9296fe0daacb6c08f247c
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/arm/allwinner-a10.c
    M hw/arm/aspeed_ast2600.c
    M hw/arm/aspeed_soc.c
    M hw/arm/nrf51_soc.c
    M hw/mips/boston.c
    M hw/mips/malta.c

  Log Message:
  -----------
  sysbus: Drop useless OBJECT() in sysbus_init_child_obj() calls

OBJECT(child) expands to ((Object *)(child)).  sysbus_init_child_obj()
parameter @child is void *.  Pass child instead of OBJECT(child).

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-40-armbru@redhat.com>


  Commit: b0d09949fe2e0d3ebe806356bf782894f5b8acc5
      
https://github.com/qemu/qemu/commit/b0d09949fe2e0d3ebe806356bf782894f5b8acc5
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/arm/microbit.c

  Log Message:
  -----------
  microbit: Tidy up sysbus_init_child_obj() @child argument

The callers of sysbus_init_child_obj() commonly pass either &child,
sizeof(child), or pchild, sizeof(*pchild).  Tidy up two that don't,
mostly to keep future commits simpler.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-41-armbru@redhat.com>


  Commit: 8352a5b8ccdaeb3fc1b00550399abc375ae62d8b
      
https://github.com/qemu/qemu/commit/8352a5b8ccdaeb3fc1b00550399abc375ae62d8b
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/arm/bcm2835_peripherals.c
    M hw/arm/mps2-tz.c
    M hw/arm/musca.c
    M hw/display/sm501.c
    M hw/microblaze/xlnx-zynqmp-pmu.c

  Log Message:
  -----------
  sysbus: Tidy up sysbus_init_child_obj()'s @childsize arg, part 1

The callers of sysbus_init_child_obj() commonly pass either &child,
sizeof(child), or pchild, sizeof(*pchild).  Tidy up the few that use
sizeof(child_type) instead, mostly to keep future commits simpler.

Coccinelle script:

    @@
    expression parent, propname, type;
    type T;
    T child;
    @@
    -    sysbus_init_child_obj(parent, propname, &child, sizeof(T), type)
    +    sysbus_init_child_obj(parent, propname, &child, sizeof(child), type)

    @@
    expression parent, propname, type;
    type T;
    T *child;
    @@
    -    sysbus_init_child_obj(parent, propname, child, sizeof(T), type)
    +    sysbus_init_child_obj(parent, propname, child, sizeof(*child), type)

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-42-armbru@redhat.com>


  Commit: 287f43196d1008b1f85d7a33593789381dde2d4b
      
https://github.com/qemu/qemu/commit/287f43196d1008b1f85d7a33593789381dde2d4b
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/arm/armsse.c

  Log Message:
  -----------
  hw/arm/armsse: Pass correct child size to sysbus_init_child_obj()

armsse_init() initializes s->armv7m[i] for all i.  It passes the size
of the entire array instead of the array element to
sysbus_init_child_obj().  Harmless, but fix it anyway.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-43-armbru@redhat.com>


  Commit: b45ad78889461fdf9aa98493a9b49612a8e79833
      
https://github.com/qemu/qemu/commit/b45ad78889461fdf9aa98493a9b49612a8e79833
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/arm/mps2-tz.c
    M hw/arm/musca.c

  Log Message:
  -----------
  sysbus: Tidy up sysbus_init_child_obj()'s @childsize arg, part 2

The callers of sysbus_init_child_obj() commonly pass either &child,
sizeof(child), or pchild, sizeof(*pchild).  Tidy up the few that use
something else instead, mostly to keep future commits simpler.

Coccinelle script:

    @@
    expression parent, propname, type;
    expression child;
    type T;
    T proxy;
    @@
    (
         sysbus_init_child_obj(parent, propname, &child, sizeof(child), type)
    |
         sysbus_init_child_obj(parent, propname, child, sizeof(*child), type)
    |
    -    sysbus_init_child_obj(parent, propname, child, sizeof(proxy), type)
    +    sysbus_init_child_obj(parent, propname, child, sizeof(*child), type)
    )

This script is *unsound*: for each change we need to verify the
@childsize argument stays the same.  I did.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-44-armbru@redhat.com>


  Commit: 496a8525622d4ac5d276f76840dd30eddb73672d
      
https://github.com/qemu/qemu/commit/496a8525622d4ac5d276f76840dd30eddb73672d
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/core/sysbus.c
    M include/hw/sysbus.h

  Log Message:
  -----------
  sysbus: New sysbus_realize(), sysbus_realize_and_unref()

Sysbus devices almost always plug into the main system bus.
qdev_create() even has a convenience feature to make that easy: a null
bus argument gets replaced by the main system bus.  qdev_realize() and
qdev_realize_and_unref() do the same.

We can do better.  Provide convenience wrappers around qdev_realize()
and qdev_realize_and_unref() that don't take a @bus argument.  They
always pass the main system bus.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-45-armbru@redhat.com>


  Commit: 3c6ef471ee67bf5a22a9e0ecfdc45ca7d2393216
      
https://github.com/qemu/qemu/commit/3c6ef471ee67bf5a22a9e0ecfdc45ca7d2393216
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/alpha/typhoon.c
    M hw/arm/exynos4210.c
    M hw/arm/exynos4_boards.c
    M hw/arm/highbank.c
    M hw/arm/integratorcp.c
    M hw/arm/mps2-tz.c
    M hw/arm/msf2-som.c
    M hw/arm/musicpal.c
    M hw/arm/netduino2.c
    M hw/arm/netduinoplus2.c
    M hw/arm/nseries.c
    M hw/arm/omap1.c
    M hw/arm/omap2.c
    M hw/arm/pxa2xx.c
    M hw/arm/pxa2xx_gpio.c
    M hw/arm/pxa2xx_pic.c
    M hw/arm/realview.c
    M hw/arm/sbsa-ref.c
    M hw/arm/spitz.c
    M hw/arm/stellaris.c
    M hw/arm/strongarm.c
    M hw/arm/versatilepb.c
    M hw/arm/vexpress.c
    M hw/arm/virt.c
    M hw/arm/xilinx_zynq.c
    M hw/arm/xlnx-versal-virt.c
    M hw/arm/xlnx-versal.c
    M hw/block/fdc.c
    M hw/block/pflash_cfi01.c
    M hw/block/pflash_cfi02.c
    M hw/char/exynos4210_uart.c
    M hw/char/mcf_uart.c
    M hw/char/serial.c
    M hw/core/sysbus.c
    M hw/cris/axis_dev88.c
    M hw/display/milkymist-tmu2.c
    M hw/display/sm501.c
    M hw/dma/pxa2xx_dma.c
    M hw/dma/rc4030.c
    M hw/dma/sparc32_dma.c
    M hw/hppa/dino.c
    M hw/hppa/lasi.c
    M hw/hppa/machine.c
    M hw/i386/pc.c
    M hw/i386/pc_q35.c
    M hw/i386/pc_sysfw.c
    M hw/i386/x86.c
    M hw/intc/exynos4210_gic.c
    M hw/intc/s390_flic.c
    M hw/isa/isa-bus.c
    M hw/lm32/lm32.h
    M hw/lm32/milkymist-hw.h
    M hw/m68k/mcf5208.c
    M hw/m68k/mcf_intc.c
    M hw/m68k/next-cube.c
    M hw/m68k/q800.c
    M hw/microblaze/petalogix_ml605_mmu.c
    M hw/microblaze/petalogix_s3adsp1800_mmu.c
    M hw/mips/boston.c
    M hw/mips/gt64xxx_pci.c
    M hw/mips/jazz.c
    M hw/mips/malta.c
    M hw/mips/mipssim.c
    M hw/misc/empty_slot.c
    M hw/net/etraxfs_eth.c
    M hw/net/fsl_etsec/etsec.c
    M hw/net/lan9118.c
    M hw/net/lasi_i82596.c
    M hw/net/smc91c111.c
    M hw/nios2/10m50_devboard.c
    M hw/nvram/fw_cfg.c
    M hw/openrisc/openrisc_sim.c
    M hw/pci-bridge/pci_expander_bridge.c
    M hw/pci-host/bonito.c
    M hw/pci-host/i440fx.c
    M hw/pcmcia/pxa2xx.c
    M hw/ppc/e500.c
    M hw/ppc/mac_newworld.c
    M hw/ppc/mac_oldworld.c
    M hw/ppc/pnv.c
    M hw/ppc/ppc440_uc.c
    M hw/ppc/prep.c
    M hw/ppc/sam460ex.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_irq.c
    M hw/ppc/spapr_vio.c
    M hw/ppc/virtex_ml507.c
    M hw/riscv/sifive_clint.c
    M hw/riscv/sifive_e_prci.c
    M hw/riscv/sifive_plic.c
    M hw/riscv/sifive_test.c
    M hw/riscv/virt.c
    M hw/rtc/m48t59.c
    M hw/rtc/sun4v-rtc.c
    M hw/s390x/ap-bridge.c
    M hw/s390x/css-bridge.c
    M hw/s390x/s390-virtio-ccw.c
    M hw/s390x/sclp.c
    M hw/sd/pxa2xx_mmci.c
    M hw/sh4/r2d.c
    M hw/sparc/leon3.c
    M hw/sparc/sun4m.c
    M hw/sparc64/sun4u.c
    M hw/xen/xen-bus.c
    M hw/xen/xen-legacy-backend.c
    M hw/xtensa/virt.c
    M hw/xtensa/xtfpga.c
    M include/hw/char/cadence_uart.h
    M include/hw/char/cmsdk-apb-uart.h
    M include/hw/char/pl011.h
    M include/hw/char/xilinx_uartlite.h
    M include/hw/cris/etraxfs.h
    M include/hw/misc/unimp.h
    M include/hw/timer/cmsdk-apb-timer.h

  Log Message:
  -----------
  sysbus: Convert to sysbus_realize() etc. with Coccinelle

Convert from qdev_realize(), qdev_realize_and_unref() with null @bus
argument to sysbus_realize(), sysbus_realize_and_unref().

Coccinelle script:

    @@
    expression dev, errp;
    @@
    -    qdev_realize(DEVICE(dev), NULL, errp);
    +    sysbus_realize(SYS_BUS_DEVICE(dev), errp);

    @@
    expression sysbus_dev, dev, errp;
    @@
    +    sysbus_dev = SYS_BUS_DEVICE(dev);
    -    qdev_realize_and_unref(dev, NULL, errp);
    +    sysbus_realize_and_unref(sysbus_dev, errp);
    -    sysbus_dev = SYS_BUS_DEVICE(dev);

    @@
    expression sysbus_dev, dev, errp;
    expression expr;
    @@
         sysbus_dev = SYS_BUS_DEVICE(dev);
         ... when != dev = expr;
    -    qdev_realize_and_unref(dev, NULL, errp);
    +    sysbus_realize_and_unref(sysbus_dev, errp);

    @@
    expression dev, errp;
    @@
    -    qdev_realize_and_unref(DEVICE(dev), NULL, errp);
    +    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), errp);

    @@
    expression dev, errp;
    @@
    -    qdev_realize_and_unref(dev, NULL, errp);
    +    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), errp);

Whitespace changes minimized manually.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-46-armbru@redhat.com>
[Conflicts in hw/misc/empty_slot.c and hw/sparc/leon3.c resolved]


  Commit: cfe91404c516551de88afbe57433a39dcdacf3c4
      
https://github.com/qemu/qemu/commit/cfe91404c516551de88afbe57433a39dcdacf3c4
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/core/qdev.c

  Log Message:
  -----------
  qdev: Drop qdev_realize() support for null bus

The "null @bus means main system bus" convenience feature is no longer
used.  Drop it.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-47-armbru@redhat.com>


  Commit: 0074fce61fecf40326845fa859119bbdd96df620
      
https://github.com/qemu/qemu/commit/0074fce61fecf40326845fa859119bbdd96df620
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/arm/bcm2835_peripherals.c
    M hw/arm/exynos4_boards.c
    M hw/arm/mps2-tz.c
    M hw/arm/mps2.c
    M hw/arm/musca.c
    M hw/arm/xlnx-versal-virt.c
    M hw/arm/xlnx-versal.c
    M hw/intc/armv7m_nvic.c
    M hw/mips/boston.c
    M hw/mips/cps.c
    M hw/mips/malta.c
    M hw/misc/mac_via.c
    M hw/riscv/spike.c
    M hw/riscv/virt.c

  Log Message:
  -----------
  sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 1

I'm converting from qdev_set_parent_bus()/realize to qdev_realize();
recent commit "qdev: Convert uses of qdev_set_parent_bus() with
Coccinelle" explains why.

sysbus_init_child_obj() is a wrapper around
object_initialize_child_with_props() and qdev_set_parent_bus().  It
passes no properties.

Convert sysbus_init_child_obj()/realize to object_initialize_child()/
qdev_realize().

Coccinelle script:

    @@
    expression parent, name, size, type, errp;
    expression child;
    symbol true;
    @@
    -    sysbus_init_child_obj(parent, name, &child, size, type);
    +    sysbus_init_child_XXX(parent, name, &child, size, type);
         ...
    -    object_property_set_bool(OBJECT(&child), true, "realized", errp);
    +    sysbus_realize(SYS_BUS_DEVICE(&child), errp);

    @@
    expression parent, name, size, type, errp;
    expression child;
    symbol true;
    @@
    -    sysbus_init_child_obj(parent, name, child, size, type);
    +    sysbus_init_child_XXX(parent, name, child, size, type);
         ...
    -    object_property_set_bool(OBJECT(child), true, "realized", errp);
    +    sysbus_realize(SYS_BUS_DEVICE(child), errp);

    @@
    expression parent, name, size, type;
    expression child;
    expression dev;
    expression expr;
    @@
    -    sysbus_init_child_obj(parent, name, child, size, type);
    +    sysbus_init_child_XXX(parent, name, child, size, type);
         ...
         dev = DEVICE(child);
         ... when != dev = expr;
    -    qdev_init_nofail(dev);
    +    sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);

    @@
    expression parent, propname, type;
    expression child;
    @@
    -    sysbus_init_child_XXX(parent, propname, child, sizeof(*child), type)
    +    object_initialize_child(parent, propname, child, type)

    @@
    expression parent, propname, type;
    expression child;
    @@
    -    sysbus_init_child_XXX(parent, propname, &child, sizeof(child), type)
    +    object_initialize_child(parent, propname, &child, type)

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-48-armbru@redhat.com>


  Commit: db873cc5d1a4aaa67eea87768d504b2f89d88738
      
https://github.com/qemu/qemu/commit/db873cc5d1a4aaa67eea87768d504b2f89d88738
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/arm/allwinner-a10.c
    M hw/arm/allwinner-h3.c
    M hw/arm/armsse.c
    M hw/arm/armv7m.c
    M hw/arm/aspeed_ast2600.c
    M hw/arm/aspeed_soc.c
    M hw/arm/bcm2835_peripherals.c
    M hw/arm/bcm2836.c
    M hw/arm/digic.c
    M hw/arm/fsl-imx25.c
    M hw/arm/fsl-imx31.c
    M hw/arm/fsl-imx6.c
    M hw/arm/fsl-imx6ul.c
    M hw/arm/fsl-imx7.c
    M hw/arm/msf2-soc.c
    M hw/arm/nrf51_soc.c
    M hw/arm/stm32f205_soc.c
    M hw/arm/stm32f405_soc.c
    M hw/arm/xlnx-zynqmp.c
    M hw/cpu/a15mpcore.c
    M hw/cpu/a9mpcore.c
    M hw/cpu/arm11mpcore.c
    M hw/cpu/realview_mpcore.c
    M hw/intc/realview_gic.c
    M hw/microblaze/xlnx-zynqmp-pmu.c
    M hw/misc/macio/cuda.c
    M hw/misc/macio/pmu.c
    M hw/ppc/pnv.c
    M hw/riscv/opentitan.c
    M hw/riscv/sifive_e.c
    M hw/riscv/sifive_u.c

  Log Message:
  -----------
  sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 2

This is the same transformation as in the previous commit, except
sysbus_init_child_obj() and realize are too separated for the commit's
Coccinelle script to handle, typically because sysbus_init_child_obj()
is in a device's instance_init() method, and the matching realize is
in its realize() method.

Perhaps a Coccinelle wizard could make it transform that pattern, but
I'm just a bungler, and the best I can do is transforming the two
separate parts separately:

    @@
    expression errp;
    expression child;
    symbol true;
    @@
    -    object_property_set_bool(OBJECT(child), true, "realized", errp);
    +    sysbus_realize(SYS_BUS_DEVICE(child), errp);
    // only correct with a matching sysbus_init_child_obj() transformation!

    @@
    expression errp;
    expression child;
    symbol true;
    @@
    -    object_property_set_bool(child, true, "realized", errp);
    +    sysbus_realize(SYS_BUS_DEVICE(child), errp);
    // only correct with a matching sysbus_init_child_obj() transformation!

    @@
    expression child;
    @@
    -    qdev_init_nofail(DEVICE(child));
    +    sysbus_realize(SYS_BUS_DEVICE(child), &error_fatal);
    // only correct with a matching sysbus_init_child_obj() transformation!

    @@
    expression child;
    expression dev;
    @@
         dev = DEVICE(child);
         ...
    -    qdev_init_nofail(dev);
    +    sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);
    // only correct with a matching sysbus_init_child_obj() transformation!

    @@
    expression child;
    identifier dev;
    @@
         DeviceState *dev = DEVICE(child);
         ...
    -    qdev_init_nofail(dev);
    +    sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);
    // only correct with a matching sysbus_init_child_obj() transformation!

    @@
    expression parent, name, size, type;
    expression child;
    symbol true;
    @@
    -    sysbus_init_child_obj(parent, name, child, size, type);
    +    sysbus_init_child_XXX(parent, name, child, size, type);

    @@
    expression parent, propname, type;
    expression child;
    @@
    -    sysbus_init_child_XXX(parent, propname, child, sizeof(*child), type)
    +    object_initialize_child(parent, propname, child, type)

    @@
    expression parent, propname, type;
    expression child;
    @@
    -    sysbus_init_child_XXX(parent, propname, &child, sizeof(child), type)
    +    object_initialize_child(parent, propname, &child, type)

This script is *unsound*: we need to manually verify init and realize
conversions are properly paired.

This commit has only the pairs where object_initialize_child()'s
@child and sysbus_realize()'s @dev argument text match exactly within
the same source file.

Note that Coccinelle chokes on ARMSSE typedef vs. macro in
hw/arm/armsse.c.  Worked around by temporarily renaming the macro for
the spatch run.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-49-armbru@redhat.com>


  Commit: 5a147c8c51d42fcdf5befc2982715b4b407f612e
      
https://github.com/qemu/qemu/commit/5a147c8c51d42fcdf5befc2982715b4b407f612e
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/arm/armsse.c
    M hw/arm/armv7m.c
    M hw/arm/microbit.c
    M hw/arm/xlnx-versal.c
    M hw/arm/xlnx-zynqmp.c
    M hw/cpu/realview_mpcore.c
    M hw/display/sm501.c
    M hw/intc/armv7m_nvic.c

  Log Message:
  -----------
  sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 3

These are init/realize pairs produced by the previous commit's
Coccinelle script where the argument test doesn't quite match.  They
need even more careful review.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-50-armbru@redhat.com>


  Commit: 7089e0cc468597556bb208ae8e3853499b746ebd
      
https://github.com/qemu/qemu/commit/7089e0cc468597556bb208ae8e3853499b746ebd
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/arm/aspeed_ast2600.c
    M hw/arm/aspeed_soc.c
    M hw/sd/aspeed_sdhci.c

  Log Message:
  -----------
  sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 4

This is still the same transformation as in the previous commits, but
here the sysbus_init_child_obj() and its matching realize in are in
separate files.  Fortunately, there's just one realize left to
convert.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-51-armbru@redhat.com>


  Commit: 034b61d79f30709cf61bafdfe83e3fbbbec9bab4
      
https://github.com/qemu/qemu/commit/034b61d79f30709cf61bafdfe83e3fbbbec9bab4
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/core/sysbus.c
    M include/hw/sysbus.h

  Log Message:
  -----------
  sysbus: sysbus_init_child_obj() is now unused, drop

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-52-armbru@redhat.com>


  Commit: e9a82986c27a1d721d983e4112f8b971374a4e21
      
https://github.com/qemu/qemu/commit/e9a82986c27a1d721d983e4112f8b971374a4e21
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/arm/microbit.c

  Log Message:
  -----------
  microbit: Eliminate two local variables in microbit_init()

Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-53-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>


  Commit: 1afec9e8ea46f8e54d0ca73b7a58f27af5edc7da
      
https://github.com/qemu/qemu/commit/1afec9e8ea46f8e54d0ca73b7a58f27af5edc7da
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/s390x/event-facility.c

  Log Message:
  -----------
  s390x/event-facility: Simplify creation of SCLP event devices

init_event_facility() creates the SCLP events bus with two SCLP event
devices (sclpquiesce and sclp-cpu-hotplug).  It leaves the devices
unrealized.  A comment explains they will be realized "via the bus".

The bus's realize method sclp_events_bus_realize() indeed realizes all
unrealized devices on this bus.  It carries a TODO comment claiming
this "has to be done in common code".  No other bus realize method
realizes its devices.

The common code in question is bus_set_realized(), which has a TODO
comment asking for recursive realization.  It's been asking for years.

The only devices sclp_events_bus_realize() will ever realize are the
two init_event_facility() puts there.

Simplify as follows:

* Make the devices members of the event facility instance struct, just
  like the bus.  object_initialize_child() is simpler than
  object_property_add_child() and object_unref().

* Realize them in the event facility realize method.

This is in line with how such things are done elsewhere.

Cc: Cornelia Huck <cohuck@redhat.com>
Cc: Halil Pasic <pasic@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: David Hildenbrand <david@redhat.com>
Cc: qemu-s390x@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-54-armbru@redhat.com>


  Commit: 510ef98dca5c44039b6f77f9752f62b5a9752c00
      
https://github.com/qemu/qemu/commit/510ef98dca5c44039b6f77f9752f62b5a9752c00
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/core/qdev.c

  Log Message:
  -----------
  qdev: Make qdev_realize() support bus-less devices

So far, qdev_realize() supports only devices that plug into a bus:
argument @bus cannot be null.  Extend it to support bus-less devices,
too.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-55-armbru@redhat.com>


  Commit: 464a22c7570d53518da5bd492b70bae1800a6556
      
https://github.com/qemu/qemu/commit/464a22c7570d53518da5bd492b70bae1800a6556
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M qdev-monitor.c

  Log Message:
  -----------
  qdev: Use qdev_realize() in qdev_device_add()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-56-armbru@redhat.com>


  Commit: ce189ab230bd3472ada876bf7568221342ee6dbb
      
https://github.com/qemu/qemu/commit/ce189ab230bd3472ada876bf7568221342ee6dbb
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/arm/allwinner-a10.c
    M hw/arm/allwinner-h3.c
    M hw/arm/armsse.c
    M hw/arm/armv7m.c
    M hw/arm/aspeed.c
    M hw/arm/aspeed_ast2600.c
    M hw/arm/aspeed_soc.c
    M hw/arm/bcm2836.c
    M hw/arm/cubieboard.c
    M hw/arm/digic.c
    M hw/arm/digic_boards.c
    M hw/arm/exynos4210.c
    M hw/arm/fsl-imx25.c
    M hw/arm/fsl-imx31.c
    M hw/arm/fsl-imx6.c
    M hw/arm/fsl-imx6ul.c
    M hw/arm/fsl-imx7.c
    M hw/arm/highbank.c
    M hw/arm/imx25_pdk.c
    M hw/arm/integratorcp.c
    M hw/arm/kzm.c
    M hw/arm/mcimx6ul-evk.c
    M hw/arm/mcimx7d-sabre.c
    M hw/arm/mps2-tz.c
    M hw/arm/mps2.c
    M hw/arm/musca.c
    M hw/arm/orangepi.c
    M hw/arm/raspi.c
    M hw/arm/realview.c
    M hw/arm/sabrelite.c
    M hw/arm/sbsa-ref.c
    M hw/arm/stm32f205_soc.c
    M hw/arm/stm32f405_soc.c
    M hw/arm/versatilepb.c
    M hw/arm/vexpress.c
    M hw/arm/virt.c
    M hw/arm/xilinx_zynq.c
    M hw/arm/xlnx-versal.c
    M hw/arm/xlnx-zcu102.c
    M hw/arm/xlnx-zynqmp.c
    M hw/block/nand.c
    M hw/char/serial-isa.c
    M hw/char/serial-pci-multi.c
    M hw/char/serial-pci.c
    M hw/char/serial.c
    M hw/core/cpu.c
    M hw/hyperv/hyperv.c
    M hw/i386/x86.c
    M hw/ide/microdrive.c
    M hw/intc/pnv_xive.c
    M hw/intc/spapr_xive.c
    M hw/intc/xics.c
    M hw/intc/xive.c
    M hw/microblaze/petalogix_ml605_mmu.c
    M hw/microblaze/petalogix_s3adsp1800_mmu.c
    M hw/microblaze/xlnx-zynqmp-pmu.c
    M hw/pci-host/pnv_phb3.c
    M hw/pci-host/pnv_phb4.c
    M hw/pci-host/pnv_phb4_pec.c
    M hw/pci-host/prep.c
    M hw/ppc/pnv.c
    M hw/ppc/pnv_bmc.c
    M hw/ppc/pnv_core.c
    M hw/ppc/pnv_psi.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_cpu_core.c
    M hw/ppc/spapr_drc.c
    M hw/ppc/spapr_iommu.c
    M hw/ppc/spapr_irq.c
    M hw/riscv/opentitan.c
    M hw/riscv/riscv_hart.c
    M hw/riscv/sifive_e.c
    M hw/riscv/sifive_u.c
    M hw/s390x/s390-skeys.c
    M hw/s390x/s390-stattrib.c
    M hw/s390x/s390-virtio-ccw.c
    M hw/s390x/sclp.c
    M hw/s390x/tod.c
    M target/i386/cpu.c
    M tests/test-qdev-global-props.c

  Log Message:
  -----------
  qdev: Convert bus-less devices to qdev_realize() with Coccinelle

All remaining conversions to qdev_realize() are for bus-less devices.
Coccinelle script:

    // only correct for bus-less @dev!

    @@
    expression errp;
    expression dev;
    @@
    -    qdev_init_nofail(dev);
    +    qdev_realize(dev, NULL, &error_fatal);

    @ depends on !(file in "hw/core/qdev.c") && !(file in "hw/core/bus.c")@
    expression errp;
    expression dev;
    symbol true;
    @@
    -    object_property_set_bool(OBJECT(dev), true, "realized", errp);
    +    qdev_realize(DEVICE(dev), NULL, errp);

    @ depends on !(file in "hw/core/qdev.c") && !(file in "hw/core/bus.c")@
    expression errp;
    expression dev;
    symbol true;
    @@
    -    object_property_set_bool(dev, true, "realized", errp);
    +    qdev_realize(DEVICE(dev), NULL, errp);

Note that Coccinelle chokes on ARMSSE typedef vs. macro in
hw/arm/armsse.c.  Worked around by temporarily renaming the macro for
the spatch run.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-57-armbru@redhat.com>


  Commit: c835fac3f074f85c6d61bcc77c509816fdf27080
      
https://github.com/qemu/qemu/commit/c835fac3f074f85c6d61bcc77c509816fdf27080
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M hw/core/qdev.c
    M include/hw/qdev-core.h

  Log Message:
  -----------
  qdev: qdev_init_nofail() is now unused, drop

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-58-armbru@redhat.com>


  Commit: b77b5b3dc7a4730d804090d359c57d33573cf85a
      
https://github.com/qemu/qemu/commit/b77b5b3dc7a4730d804090d359c57d33573cf85a
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-06-15 (Mon, 15 Jun 2020)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: Make section QOM cover hw/core/*bus.c as well

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-59-armbru@redhat.com>


  Commit: 6675a653d2e57ab09c32c0ea7b44a1d6c40a7f58
      
https://github.com/qemu/qemu/commit/6675a653d2e57ab09c32c0ea7b44a1d6c40a7f58
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-06-16 (Tue, 16 Jun 2020)

  Changed paths:
    M MAINTAINERS
    M hw/acpi/pcihp.c
    M hw/acpi/piix4.c
    M hw/alpha/typhoon.c
    M hw/arm/allwinner-a10.c
    M hw/arm/allwinner-h3.c
    M hw/arm/armsse.c
    M hw/arm/armv7m.c
    M hw/arm/aspeed.c
    M hw/arm/aspeed_ast2600.c
    M hw/arm/aspeed_soc.c
    M hw/arm/bcm2835_peripherals.c
    M hw/arm/bcm2836.c
    M hw/arm/cubieboard.c
    M hw/arm/digic.c
    M hw/arm/digic_boards.c
    M hw/arm/exynos4210.c
    M hw/arm/exynos4_boards.c
    M hw/arm/fsl-imx25.c
    M hw/arm/fsl-imx31.c
    M hw/arm/fsl-imx6.c
    M hw/arm/fsl-imx6ul.c
    M hw/arm/fsl-imx7.c
    M hw/arm/highbank.c
    M hw/arm/imx25_pdk.c
    M hw/arm/integratorcp.c
    M hw/arm/kzm.c
    M hw/arm/mcimx6ul-evk.c
    M hw/arm/mcimx7d-sabre.c
    M hw/arm/microbit.c
    M hw/arm/mps2-tz.c
    M hw/arm/mps2.c
    M hw/arm/msf2-soc.c
    M hw/arm/msf2-som.c
    M hw/arm/musca.c
    M hw/arm/musicpal.c
    M hw/arm/netduino2.c
    M hw/arm/netduinoplus2.c
    M hw/arm/nrf51_soc.c
    M hw/arm/nseries.c
    M hw/arm/omap1.c
    M hw/arm/omap2.c
    M hw/arm/orangepi.c
    M hw/arm/pxa2xx.c
    M hw/arm/pxa2xx_gpio.c
    M hw/arm/pxa2xx_pic.c
    M hw/arm/raspi.c
    M hw/arm/realview.c
    M hw/arm/sabrelite.c
    M hw/arm/sbsa-ref.c
    M hw/arm/spitz.c
    M hw/arm/stellaris.c
    M hw/arm/stm32f205_soc.c
    M hw/arm/stm32f405_soc.c
    M hw/arm/strongarm.c
    M hw/arm/versatilepb.c
    M hw/arm/vexpress.c
    M hw/arm/virt.c
    M hw/arm/xilinx_zynq.c
    M hw/arm/xlnx-versal-virt.c
    M hw/arm/xlnx-versal.c
    M hw/arm/xlnx-zcu102.c
    M hw/arm/xlnx-zynqmp.c
    M hw/audio/intel-hda.c
    M hw/block/fdc.c
    M hw/block/nand.c
    M hw/block/pflash_cfi01.c
    M hw/block/pflash_cfi02.c
    M hw/block/xen-block.c
    M hw/char/exynos4210_uart.c
    M hw/char/mcf_uart.c
    M hw/char/parallel-isa.c
    M hw/char/serial-isa.c
    M hw/char/serial-pci-multi.c
    M hw/char/serial-pci.c
    M hw/char/serial.c
    M hw/char/spapr_vty.c
    M hw/core/bus.c
    M hw/core/cpu.c
    M hw/core/qdev.c
    M hw/core/sysbus.c
    M hw/cpu/a15mpcore.c
    M hw/cpu/a9mpcore.c
    M hw/cpu/arm11mpcore.c
    M hw/cpu/realview_mpcore.c
    M hw/cris/axis_dev88.c
    M hw/display/ati.c
    M hw/display/milkymist-tmu2.c
    M hw/display/sm501.c
    M hw/display/virtio-gpu-pci.c
    M hw/display/virtio-vga.c
    M hw/display/xlnx_dp.c
    M hw/dma/i8257.c
    M hw/dma/pxa2xx_dma.c
    M hw/dma/rc4030.c
    M hw/dma/sparc32_dma.c
    M hw/dma/xilinx_axidma.c
    M hw/hppa/dino.c
    M hw/hppa/lasi.c
    M hw/hppa/machine.c
    M hw/hyperv/hyperv.c
    M hw/i2c/core.c
    M hw/i2c/smbus_eeprom.c
    M hw/i386/amd_iommu.c
    M hw/i386/pc.c
    M hw/i386/pc_q35.c
    M hw/i386/pc_sysfw.c
    M hw/i386/x86.c
    M hw/ide/isa.c
    M hw/ide/microdrive.c
    M hw/ide/qdev.c
    M hw/intc/armv7m_nvic.c
    M hw/intc/exynos4210_gic.c
    M hw/intc/i8259_common.c
    M hw/intc/pnv_xive.c
    M hw/intc/realview_gic.c
    M hw/intc/s390_flic.c
    M hw/intc/spapr_xive.c
    M hw/intc/xics.c
    M hw/intc/xive.c
    M hw/isa/isa-bus.c
    M hw/isa/isa-superio.c
    M hw/isa/piix4.c
    M hw/isa/vt82c686.c
    M hw/lm32/lm32.h
    M hw/lm32/milkymist-hw.h
    M hw/m68k/mcf5208.c
    M hw/m68k/mcf_intc.c
    M hw/m68k/next-cube.c
    M hw/m68k/q800.c
    M hw/microblaze/petalogix_ml605_mmu.c
    M hw/microblaze/petalogix_s3adsp1800_mmu.c
    M hw/microblaze/xlnx-zynqmp-pmu.c
    M hw/mips/boston.c
    M hw/mips/cps.c
    M hw/mips/fuloong2e.c
    M hw/mips/gt64xxx_pci.c
    M hw/mips/jazz.c
    M hw/mips/malta.c
    M hw/mips/mipssim.c
    M hw/misc/auxbus.c
    M hw/misc/empty_slot.c
    M hw/misc/mac_via.c
    M hw/misc/macio/cuda.c
    M hw/misc/macio/macio.c
    M hw/misc/macio/pmu.c
    M hw/net/etraxfs_eth.c
    M hw/net/fsl_etsec/etsec.c
    M hw/net/lan9118.c
    M hw/net/lasi_i82596.c
    M hw/net/smc91c111.c
    M hw/net/spapr_llan.c
    M hw/net/xilinx_axienet.c
    M hw/nios2/10m50_devboard.c
    M hw/nvram/fw_cfg.c
    M hw/openrisc/openrisc_sim.c
    M hw/pci-bridge/dec.c
    M hw/pci-bridge/pci_expander_bridge.c
    M hw/pci-host/bonito.c
    M hw/pci-host/designware.c
    M hw/pci-host/gpex.c
    M hw/pci-host/i440fx.c
    M hw/pci-host/pnv_phb3.c
    M hw/pci-host/pnv_phb4.c
    M hw/pci-host/pnv_phb4_pec.c
    M hw/pci-host/prep.c
    M hw/pci-host/q35.c
    M hw/pci-host/sabre.c
    M hw/pci-host/versatile.c
    M hw/pci-host/xilinx-pcie.c
    M hw/pci/pci.c
    M hw/pci/pcie.c
    M hw/pci/shpc.c
    M hw/pcmcia/pxa2xx.c
    M hw/ppc/e500.c
    M hw/ppc/mac_newworld.c
    M hw/ppc/mac_oldworld.c
    M hw/ppc/pnv.c
    M hw/ppc/pnv_bmc.c
    M hw/ppc/pnv_core.c
    M hw/ppc/pnv_psi.c
    M hw/ppc/ppc440_uc.c
    M hw/ppc/prep.c
    M hw/ppc/sam460ex.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_cpu_core.c
    M hw/ppc/spapr_drc.c
    M hw/ppc/spapr_iommu.c
    M hw/ppc/spapr_irq.c
    M hw/ppc/spapr_pci.c
    M hw/ppc/spapr_vio.c
    M hw/ppc/virtex_ml507.c
    M hw/riscv/opentitan.c
    M hw/riscv/riscv_hart.c
    M hw/riscv/sifive_clint.c
    M hw/riscv/sifive_e.c
    M hw/riscv/sifive_e_prci.c
    M hw/riscv/sifive_plic.c
    M hw/riscv/sifive_test.c
    M hw/riscv/sifive_u.c
    M hw/riscv/spike.c
    M hw/riscv/virt.c
    M hw/rtc/m48t59-isa.c
    M hw/rtc/m48t59.c
    M hw/rtc/mc146818rtc.c
    M hw/rtc/sun4v-rtc.c
    M hw/s390x/ap-bridge.c
    M hw/s390x/css-bridge.c
    M hw/s390x/event-facility.c
    M hw/s390x/s390-pci-bus.c
    M hw/s390x/s390-skeys.c
    M hw/s390x/s390-stattrib.c
    M hw/s390x/s390-virtio-ccw.c
    M hw/s390x/sclp.c
    M hw/s390x/tod.c
    M hw/s390x/vhost-vsock-ccw.c
    M hw/s390x/virtio-ccw-9p.c
    M hw/s390x/virtio-ccw-balloon.c
    M hw/s390x/virtio-ccw-blk.c
    M hw/s390x/virtio-ccw-crypto.c
    M hw/s390x/virtio-ccw-gpu.c
    M hw/s390x/virtio-ccw-input.c
    M hw/s390x/virtio-ccw-net.c
    M hw/s390x/virtio-ccw-rng.c
    M hw/s390x/virtio-ccw-scsi.c
    M hw/s390x/virtio-ccw-serial.c
    M hw/scsi/scsi-bus.c
    M hw/scsi/spapr_vscsi.c
    M hw/sd/aspeed_sdhci.c
    M hw/sd/milkymist-memcard.c
    M hw/sd/pxa2xx_mmci.c
    M hw/sd/sd.c
    M hw/sd/ssi-sd.c
    M hw/sh4/r2d.c
    M hw/sparc/leon3.c
    M hw/sparc/sun4m.c
    M hw/sparc64/sun4u.c
    M hw/ssi/aspeed_smc.c
    M hw/ssi/imx_spi.c
    M hw/ssi/mss-spi.c
    M hw/ssi/ssi.c
    M hw/ssi/xilinx_spi.c
    M hw/ssi/xilinx_spips.c
    M hw/usb/bus.c
    M hw/usb/dev-serial.c
    M hw/virtio/vhost-scsi-pci.c
    M hw/virtio/vhost-user-blk-pci.c
    M hw/virtio/vhost-user-fs-pci.c
    M hw/virtio/vhost-user-scsi-pci.c
    M hw/virtio/vhost-user-vsock-pci.c
    M hw/virtio/vhost-vsock-pci.c
    M hw/virtio/virtio-9p-pci.c
    M hw/virtio/virtio-balloon-pci.c
    M hw/virtio/virtio-blk-pci.c
    M hw/virtio/virtio-crypto-pci.c
    M hw/virtio/virtio-input-pci.c
    M hw/virtio/virtio-iommu-pci.c
    M hw/virtio/virtio-net-pci.c
    M hw/virtio/virtio-pmem-pci.c
    M hw/virtio/virtio-rng-pci.c
    M hw/virtio/virtio-scsi-pci.c
    M hw/virtio/virtio-serial-pci.c
    M hw/virtio/virtio.c
    M hw/xen/xen-bus.c
    M hw/xen/xen-legacy-backend.c
    M hw/xtensa/virt.c
    M hw/xtensa/xtfpga.c
    M include/hw/arm/aspeed.h
    M include/hw/arm/aspeed_soc.h
    M include/hw/audio/pcspk.h
    M include/hw/char/cadence_uart.h
    M include/hw/char/cmsdk-apb-uart.h
    M include/hw/char/pl011.h
    M include/hw/char/xilinx_uartlite.h
    M include/hw/cris/etraxfs.h
    M include/hw/isa/isa.h
    M include/hw/misc/auxbus.h
    M include/hw/misc/unimp.h
    M include/hw/net/ne2000-isa.h
    M include/hw/pci/pci.h
    M include/hw/ppc/pnv_psi.h
    M include/hw/qdev-core.h
    M include/hw/riscv/sifive_e.h
    M include/hw/riscv/sifive_u.h
    M include/hw/ssi/ssi.h
    M include/hw/sysbus.h
    M include/hw/timer/cmsdk-apb-timer.h
    M include/hw/timer/i8254.h
    M include/hw/usb.h
    M include/qom/object.h
    M migration/migration.c
    M qdev-monitor.c
    M qom/object.c
    M qom/qom-hmp-cmds.c
    M target/i386/cpu.c
    M tests/test-qdev-global-props.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/armbru/tags/pull-qom-2020-06-15' into 
staging

QOM patches for 2020-06-15

# gpg: Signature made Mon 15 Jun 2020 21:07:19 BST
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-qom-2020-06-15: (84 commits)
  MAINTAINERS: Make section QOM cover hw/core/*bus.c as well
  qdev: qdev_init_nofail() is now unused, drop
  qdev: Convert bus-less devices to qdev_realize() with Coccinelle
  qdev: Use qdev_realize() in qdev_device_add()
  qdev: Make qdev_realize() support bus-less devices
  s390x/event-facility: Simplify creation of SCLP event devices
  microbit: Eliminate two local variables in microbit_init()
  sysbus: sysbus_init_child_obj() is now unused, drop
  sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 4
  sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 3
  sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 2
  sysbus: Convert qdev_set_parent_bus() use with Coccinelle, part 1
  qdev: Drop qdev_realize() support for null bus
  sysbus: Convert to sysbus_realize() etc. with Coccinelle
  sysbus: New sysbus_realize(), sysbus_realize_and_unref()
  sysbus: Tidy up sysbus_init_child_obj()'s @childsize arg, part 2
  hw/arm/armsse: Pass correct child size to sysbus_init_child_obj()
  sysbus: Tidy up sysbus_init_child_obj()'s @childsize arg, part 1
  microbit: Tidy up sysbus_init_child_obj() @child argument
  sysbus: Drop useless OBJECT() in sysbus_init_child_obj() calls
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/f5e34624f28f...6675a653d2e5



reply via email to

[Prev in Thread] Current Thread [Next in Thread]