[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH RFC 2/2] hw: Replace drive_get_next() by drive_get()
From: |
Peter Maydell |
Subject: |
Re: [PATCH RFC 2/2] hw: Replace drive_get_next() by drive_get() |
Date: |
Mon, 15 Nov 2021 13:38:43 +0000 |
On Mon, 15 Nov 2021 at 12:55, Markus Armbruster <armbru@redhat.com> wrote:
>
> drive_get_next() is basically a bad idea. It returns the "next" block
> backend of a certain interface type. "Next" means bus=0,unit=N, where
> subsequent calls count N up from zero, per interface type.
>
> This lets you define unit numbers implicitly by execution order. If the
> order changes, or new calls appear "in the middle", unit numbers change.
> ABI break. Hard to spot in review.
>
> Explicit is better than implicit: use drive_get() directly.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> include/sysemu/blockdev.h | 1 -
> blockdev.c | 10 ----------
> hw/arm/aspeed.c | 21 +++++++++++++--------
> hw/arm/cubieboard.c | 2 +-
> hw/arm/imx25_pdk.c | 2 +-
> hw/arm/integratorcp.c | 2 +-
> hw/arm/mcimx6ul-evk.c | 2 +-
> hw/arm/mcimx7d-sabre.c | 2 +-
> hw/arm/msf2-som.c | 2 +-
> hw/arm/npcm7xx_boards.c | 6 +++---
> hw/arm/orangepi.c | 2 +-
> hw/arm/raspi.c | 2 +-
> hw/arm/realview.c | 2 +-
> hw/arm/sabrelite.c | 2 +-
> hw/arm/versatilepb.c | 4 ++--
> hw/arm/vexpress.c | 6 +++---
> hw/arm/xilinx_zynq.c | 16 +++++++++-------
> hw/arm/xlnx-versal-virt.c | 3 ++-
> hw/arm/xlnx-zcu102.c | 6 +++---
> hw/microblaze/petalogix_ml605_mmu.c | 2 +-
> hw/misc/sifive_u_otp.c | 2 +-
> hw/riscv/microchip_pfsoc.c | 2 +-
> hw/sparc64/niagara.c | 2 +-
> 23 files changed, 49 insertions(+), 52 deletions(-)
This would be easier to review if it didn't try to change all of
these board/SoC models at once. Each one of them is entirely
separate review work.
-- PMM
[PATCH RFC 1/2] hw/sd/ssi-sd: Do not create SD card within controller's realize, Markus Armbruster, 2021/11/15