[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 04/13] hw/arm/versatilepb hw/arm/vexpress: Replace drive_g
From: |
Peter Maydell |
Subject: |
Re: [PATCH v2 04/13] hw/arm/versatilepb hw/arm/vexpress: Replace drive_get_next() by drive_get() |
Date: |
Mon, 29 Nov 2021 13:21:51 +0000 |
On Wed, 17 Nov 2021 at 16:34, 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.
>
> The versatile and vexpress machines ("versatileab", "versatilepb",
> "vexpress-a9", "vexpress-a15") connect just one or two backends of a
> type with drive_get_next(). Change them to use drive_get() directly.
> This makes the unit numbers explicit in the code.
>
> 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>
thanks
-- PMM
- [PATCH v2 00/13] Eliminate drive_get_next(), Markus Armbruster, 2021/11/17
- [PATCH v2 07/13] hw/arm/mcimx7d-sabre: Replace drive_get_next() by drive_get(), Markus Armbruster, 2021/11/17
- [PATCH v2 09/13] hw/microblaze: Replace drive_get_next() by drive_get(), Markus Armbruster, 2021/11/17
- [PATCH v2 04/13] hw/arm/versatilepb hw/arm/vexpress: Replace drive_get_next() by drive_get(), Markus Armbruster, 2021/11/17
- Re: [PATCH v2 04/13] hw/arm/versatilepb hw/arm/vexpress: Replace drive_get_next() by drive_get(),
Peter Maydell <=
- [PATCH v2 02/13] hw: Replace trivial drive_get_next() by drive_get(), Markus Armbruster, 2021/11/17
- [PATCH v2 01/13] hw/sd/ssi-sd: Do not create SD card within controller's realize, Markus Armbruster, 2021/11/17
- [PATCH v2 13/13] blockdev: Drop unused drive_get_next(), Markus Armbruster, 2021/11/17
- [PATCH v2 12/13] hw/arm/aspeed: Replace drive_get_next() by drive_get(), Markus Armbruster, 2021/11/17
- [PATCH v2 08/13] hw/arm/xlnx-versal-virt: Replace drive_get_next() by drive_get(), Markus Armbruster, 2021/11/17