[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 17/32] blockdev: Separate bochs probe from it
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v3 17/32] blockdev: Separate bochs probe from its driver |
Date: |
Fri, 8 Jul 2016 11:57:36 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 07.07.2016 um 16:56 hat Colin Lord geschrieben:
> On 07/06/2016 11:59 AM, Max Reitz wrote:
> > On 05.07.2016 17:24, Colin Lord wrote:
> >> Modifies the bochs probe to return the format name as well as the
> >> score as the final step of separating the probe function from the
> >> driver. This keeps the probe completely independent of the driver,
> >> making future modularization easier to accomplish. Returning the format
> >> name as well as the score allows the score to be correlated to the
> >> driver without the probe function needing to be part of the driver.
> >>
> >> Signed-off-by: Colin Lord <address@hidden>
> >> ---
> >> block.c | 19 +++++++++++++++++++
> >> block/bochs.c | 1 -
> >> block/probe/bochs.c | 25 ++++++++++++++++---------
> >> include/block/probe.h | 3 ++-
> >> 4 files changed, 37 insertions(+), 11 deletions(-)
> >
> > Oh, and another comment: I think it would be better to split this patch
> > into a part that modifies block.c (introducing the format_probes array
> > and using it in bdrv_probe_all()) and another one that actually does the
> > bochs-specific stuff.
> >
> > Max
> >
> I could do that, but if I leave the variable i as an unsigned type, I
> get compiler warnings/errors that the for loop condition of
> i < ARRAY_SIZE(format_probes)
> must be false since the size of format_probes will be 0 (and unsigned is
> always positive). Is it okay to change the type to int? Not sure how
> strictly this aspect of the coding style gets enforced.
Leave it unsigned. The resulting code after the series is more important
than having the nicest possible split. If this means that you need to
leave both parts in the same patch, so be it.
Kevin
- [Qemu-devel] [PATCH v3 30/32] blockdev: Remove the .bdrv_probe field from BlockDrivers, (continued)
- [Qemu-devel] [PATCH v3 22/32] blockdev: Separate qcow probe from its driver, Colin Lord, 2016/07/05
- [Qemu-devel] [PATCH v3 21/32] blockdev: Separate parallels probe from its driver, Colin Lord, 2016/07/05
- [Qemu-devel] [PATCH v3 27/32] blockdev: Separate vhdx probe from its driver, Colin Lord, 2016/07/05
- [Qemu-devel] [PATCH v3 25/32] blockdev: Separate raw probe from its driver, Colin Lord, 2016/07/05
- Re: [Qemu-devel] [Qemu-block] [PATCH v3 00/32] Dynamic module loading for block drivers, John Snow, 2016/07/07
- Re: [Qemu-devel] [Qemu-block] [PATCH v3 00/32] Dynamic module loading for block drivers, Stefan Hajnoczi, 2016/07/14