[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [qemu/qemu] af9e40: hw: Mark devices picking up block bac
From: |
GitHub |
Subject: |
[Qemu-commits] [qemu/qemu] af9e40: hw: Mark devices picking up block backends activel... |
Date: |
Thu, 02 Apr 2015 08:00:08 -0700 |
Branch: refs/heads/master
Home: https://github.com/qemu/qemu
Commit: af9e40aa8f36e30e89f16323b3d341ee59309b7e
https://github.com/qemu/qemu/commit/af9e40aa8f36e30e89f16323b3d341ee59309b7e
Author: Markus Armbruster <address@hidden>
Date: 2015-04-02 (Thu, 02 Apr 2015)
Changed paths:
M hw/arm/spitz.c
M hw/block/m25p80.c
M hw/isa/pc87312.c
M hw/sd/milkymist-memcard.c
M hw/sd/pl181.c
M hw/sd/sdhci.c
M hw/sd/ssi-sd.c
Log Message:
-----------
hw: Mark devices picking up block backends actively FIXME
Drives defined with if!=none are for board initialization to wire up.
Board code calls drive_get() or similar to find them, and creates
devices with their qdev drive properties set accordingly.
Except a few devices go on a fishing expedition for a suitable backend
instead of exposing a drive property for board code to set: they call
driver_get() or drive_get_next() in their realize() or init() method
to implicitly connect to the "next" backend with a certain interface
type.
Picking up backends that way works when the devices are created by
board code. But it's inappropriate for -device or device_add. Not
only is this inconsistent with how the other block device models work
(they connect to a backend explicitly identified by a "drive"
property), it breaks when the "next" backend has been picked up by the
board already.
Example:
$ qemu-system-arm -S -M connex -pflash flash.img -device ssi-sd
Aborted (core dumped)
Mark them with suitable FIXME comments.
Cc: Andrzej Zaborowski <address@hidden>
Cc: Peter Crosthwaite <address@hidden>
Cc: "Andreas Färber" <address@hidden>
Cc: Michael Walle <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Commit: d71b22bb6ae281e66dfa17733105468f830a8c6a
https://github.com/qemu/qemu/commit/d71b22bb6ae281e66dfa17733105468f830a8c6a
Author: Markus Armbruster <address@hidden>
Date: 2015-04-02 (Thu, 02 Apr 2015)
Changed paths:
M hw/arm/allwinner-a10.c
M hw/char/cadence_uart.c
M hw/char/digic-uart.c
M hw/char/etraxfs_ser.c
M hw/char/lm32_juart.c
M hw/char/lm32_uart.c
M hw/char/milkymist-uart.c
M hw/char/pl011.c
M hw/char/stm32f2xx_usart.c
M hw/char/xilinx_uartlite.c
M hw/isa/pc87312.c
Log Message:
-----------
hw: Mark devices picking up char backends actively FIXME
Character devices defined with -serial and -parallel are for board
initialization to wire up. Board code examines serial_hds[] and
parallel_hds[] to find them, and creates devices with their qdev
chardev properties set accordingly.
Except a few devices go on a fishing expedition for a suitable backend
instead of exposing a chardev property for board code to set: they use
serial_hds[] (often via qemu_char_get_next_serial()) or parallel_hds[]
in their realize() or init() method to connect to a backend.
Picking up backends that way works when the devices are created by
board code. But it's inappropriate for -device or device_add. Not
only is it inconsistent with how the other characrer device models
work (they connect to a backend explicitly identified by a "chardev"
property), it breaks when the backend has been picked up by the board
or a previous -device / device_add already.
Example:
$ qemu-system-ppc64 -M bamboo -S -device i82378 -device pc87312 -device
pc87312
qemu-system-ppc64: -device pc87312: Property 'isa-parallel.chardev' can't
take value 'parallel0', it's in use
Mark them with suitable FIXME comments.
Cc: Li Guang <address@hidden>
Cc: Peter Crosthwaite <address@hidden>
Cc: Antony Pavlov <address@hidden>
Cc: "Edgar E. Iglesias" <address@hidden>
Cc: Michael Walle <address@hidden>
Cc: Peter Crosthwaite <address@hidden>
Cc: "Andreas Färber" <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Commit: 19f33f16890fc5ec0d43841625ca44ef28767d1a
https://github.com/qemu/qemu/commit/19f33f16890fc5ec0d43841625ca44ef28767d1a
Author: Markus Armbruster <address@hidden>
Date: 2015-04-02 (Thu, 02 Apr 2015)
Changed paths:
M hw/arm/allwinner-a10.c
Log Message:
-----------
hw: Mark device misusing nd_table[] FIXME
NICs defined with -net nic are for board initialization to wire up.
Board code examines nd_table[] to find them, and creates devices with
their qdev NIC properties set accordingly.
Except "allwinner-a10" goes on a fishing expedition for NIC
configuration instead of exposing the usual NIC properties for board
code to set: it uses nd_table[0] in its instance_init() method.
Picking up the first -net nic option's configuration that way works
when the device is created by board code. But it's inappropriate for
-device and device_add. Not only is it inconsistent with how the
other block device models work (they get their configuration from
properties "mac", "vlan", "netdev"), it breaks when nd_table[0] has
been picked up by the board or a previous -device / device_add
already.
Example:
$ qemu-system-arm -S -M cubieboard -device allwinner-a10
qemu-system-arm: -device allwinner-a10: Property 'allwinner-emac.netdev'
can't take value 'hub0port0', it's in use
Aborted (core dumped)
It also breaks in other entertaining ways:
$ qemu-system-arm -M highbank -device allwinner-a10
qemu-system-arm: -device allwinner-a10: Unsupported NIC model: xgmac
$ qemu-system-arm -M highbank -net nic,model=allwinner-emac -device
allwinner-a10
qemu-system-arm: Unsupported NIC model: allwinner-emac
Mark the mistake with a FIXME comment.
Cc: Li Guang <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Commit: 19109131ca2701de1b4e083bd51172f376f7a5ef
https://github.com/qemu/qemu/commit/19109131ca2701de1b4e083bd51172f376f7a5ef
Author: Markus Armbruster <address@hidden>
Date: 2015-04-02 (Thu, 02 Apr 2015)
Changed paths:
M hw/sd/sdhci.c
Log Message:
-----------
sdhci: Make device "sdhci-pci" unavailable with -device
Device models aren't supposed to go on fishing expeditions for
backends. They should expose suitable properties for the user to set.
For onboard devices, board code sets them.
"sdhci-pci" picks up its block backend in its realize() method with
drive_get_next() instead. Already marked FIXME. See the commit that
added the FIXME for a more detailed explanation of what's wrong.
We can't fix this in time for the release, but since the device is new
in 2.3, we can set cannot_instantiate_with_device_add_yet to disable
it before this mistake becomes ABI, and we have to support command
lines like
$ qemu -drive if=sd -drive if=sd,file=sd.img -device sdhci-pci -device
sdhci-pci
forever.
Signed-off-by: Markus Armbruster <address@hidden>
Commit: 9f9bdf43cac28251f8cb33b77fed5e19225375c4
https://github.com/qemu/qemu/commit/9f9bdf43cac28251f8cb33b77fed5e19225375c4
Author: Markus Armbruster <address@hidden>
Date: 2015-04-02 (Thu, 02 Apr 2015)
Changed paths:
M hw/arm/spitz.c
M hw/char/cadence_uart.c
M hw/char/digic-uart.c
M hw/char/etraxfs_ser.c
M hw/char/lm32_juart.c
M hw/char/lm32_uart.c
M hw/char/milkymist-uart.c
M hw/char/pl011.c
M hw/char/stm32f2xx_usart.c
M hw/char/xilinx_uartlite.c
M hw/sd/milkymist-memcard.c
M hw/sd/pl181.c
M hw/sd/sdhci.c
Log Message:
-----------
sysbus: Make devices picking up backends unavailable with -device
Device models aren't supposed to go on fishing expeditions for
backends. They should expose suitable properties for the user to set.
For onboard devices, board code sets them.
A number of sysbus devices pick up block backends in their init() /
instance_init() methods with drive_get_next() instead: sl-nand,
milkymist-memcard, pl181, generic-sdhci.
Likewise, a number of sysbus devices pick up character backends in
their init() / realize() methods with qemu_char_get_next_serial():
cadence_uart, digic-uart, etraxfs,serial, lm32-juart, lm32-uart,
milkymist-uart, pl011, stm32f2xx-usart, xlnx.xps-uartlite.
All these mistakes are already marked FIXME. See the commit that
added these FIXMEs for a more detailed explanation of what's wrong.
Fortunately, only machines ppce500 and pseries-* support -device with
sysbus devices, and none of the devices above is supported with these
machines.
Set cannot_instantiate_with_device_add_yet to preserve our luck.
Cc: Andrzej Zaborowski <address@hidden>
Cc: Peter Crosthwaite <address@hidden>
Cc: Antony Pavlov <address@hidden>
Cc: "Edgar E. Iglesias" <address@hidden>
Cc: Michael Walle <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Commit: 913fbe9a6a05296132b5fab431bf1c377a0bbf1a
https://github.com/qemu/qemu/commit/913fbe9a6a05296132b5fab431bf1c377a0bbf1a
Author: Peter Maydell <address@hidden>
Date: 2015-04-02 (Thu, 02 Apr 2015)
Changed paths:
M hw/arm/allwinner-a10.c
M hw/arm/spitz.c
M hw/block/m25p80.c
M hw/char/cadence_uart.c
M hw/char/digic-uart.c
M hw/char/etraxfs_ser.c
M hw/char/lm32_juart.c
M hw/char/lm32_uart.c
M hw/char/milkymist-uart.c
M hw/char/pl011.c
M hw/char/stm32f2xx_usart.c
M hw/char/xilinx_uartlite.c
M hw/isa/pc87312.c
M hw/sd/milkymist-memcard.c
M hw/sd/pl181.c
M hw/sd/sdhci.c
M hw/sd/ssi-sd.c
Log Message:
-----------
Merge remote-tracking branch 'remotes/armbru/tags/pull-hw-2015-04-02' into
staging
hw: Contain drive, serial, parallel, net misuse
# gpg: Signature made Thu Apr 2 14:32:00 2015 BST using RSA key ID EB918653
# gpg: Good signature from "Markus Armbruster <address@hidden>"
# gpg: aka "Markus Armbruster <address@hidden>"
* remotes/armbru/tags/pull-hw-2015-04-02:
sysbus: Make devices picking up backends unavailable with -device
sdhci: Make device "sdhci-pci" unavailable with -device
hw: Mark device misusing nd_table[] FIXME
hw: Mark devices picking up char backends actively FIXME
hw: Mark devices picking up block backends actively FIXME
Signed-off-by: Peter Maydell <address@hidden>
Compare: https://github.com/qemu/qemu/compare/11f10cf8057d...913fbe9a6a05
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-commits] [qemu/qemu] af9e40: hw: Mark devices picking up block backends activel...,
GitHub <=