From: Max Reitz <mreitz@redhat.com>
To: John Snow <jsnow@redhat.com>,
"Daniel P. Berrange" <berrange@redhat.com>,
Colin Lord <clord@redhat.com>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v3 04/32] blockdev: Move bochs probe into separate file
Date: Tue, 5 Jul 2016 23:00:42 +0200 [thread overview]
Message-ID: <daeaea9d-8547-5319-7a17-a28c408bd45f@redhat.com> (raw)
In-Reply-To: <32a142e7-8e46-9ae7-30b0-df42876601cb@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3477 bytes --]
On 05.07.2016 22:50, John Snow wrote:
>
>
> On 07/05/2016 11:49 AM, Daniel P. Berrange wrote:
>> On Tue, Jul 05, 2016 at 11:24:04AM -0400, Colin Lord wrote:
>>> This puts the bochs probe function into its own separate file as part of
>>> the process of modularizing block drivers. Having the probe functions
>>> separate from the rest of the driver allows us to probe without having
>>> to potentially unnecessarily load the driver.
>>>
>>> Signed-off-by: Colin Lord <clord@redhat.com>
>>> ---
>>> block/Makefile.objs | 1 +
>>> block/bochs.c | 55 ++------------------------------------------
>>> block/probe/bochs.c | 21 +++++++++++++++++
>>
>> Do we really need a sub-dir for this ? If we were going to
>> have sub-dirs under block/, I'd suggest we have one subdir
>> per block driver, not spread code for one block driver
>> across multiple dirs.
>>
>
> Admittedly I have been nudging Colin to shoot from the hip a bit on
> filename organization because I was short of ideas.
>
> Some ideas:
>
> (1) A combined probe.c file. This keeps the existing organization and
> localizes everything to just one new file.
>
> Downside: many formats rely on at least some minimal amount of structure
> and constant definitions, and some of those overlap with each other.
> qcow and qcow2 both using "QcowHeader" would be a prominent example.
>
> They could all be disentangled, but it's less clear on where all the
> common definitions go. A common probe.h is a bad idea since the modular
> portion of the driver has no business gaining access to other formats'
> definitions. We could create a probe.c and matching
> include/block/bdrv/fmt.h includes, but we lost our zeal for this method.
>
> (2) Separate probe files for each driver.
>
> What we went with. Keeps refactoring to a minimum. Adds a bunch of
> little files, but it's minimal and fairly noninvasive.
>
> Like #1 though, we still have to figure out what to do with the common
> includes.
>
>> IMHO a block/bochs-probe.c would be better, unless we did
>> move block/bochs.c into a block/bochs/driver.c dir.
>>
>> Either way, you should update MAINTAINERS file to record
>> this newly added filename, against the bochs entry. The
>> same applies to most other patches in this series adding
>> new files.
>>
>>
>> Regards,
>> Daniel
>>
>
> So, something like:
>
> block/drivers/bochs/
>
> bochs.c
> probe.c (or bochs-probe.c)
>
> and
>
> include/block/drivers/bochs/
>
> common.h (or internal.h)
>
>
> Any objections from the gallery?
Yea (or “Nay”?). I'd rather not have as many directories in block/ as we
have files there right now and in most of these directories just two
files, for two reasons:
(1) I don't want it, because of my personal taste. If you just did it, I
probably wouldn't complain for too long, though.
(2) Code motion shouldn't be done without a good reason. I know this is
of no concern to upstream (which we are talking about), but it's always
iffy when it comes to backports. And I am a Red Hat employee, so I am
paid to think about them.
Also, there's another argument: As far as I know we sooner or later want
to make probing some kind of a block driver anyway (i.e. if you choose
the "probe" block driver, it'll automatically replace itself by the
right one). So in that sense, one could actually argue that probing is a
block driver.
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 498 bytes --]
next prev parent reply other threads:[~2016-07-05 21:00 UTC|newest]
Thread overview: 89+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-05 15:24 [Qemu-devel] [PATCH v3 00/32] Dynamic module loading for block drivers Colin Lord
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 01/32] blockdev: prepare iSCSI block driver for dynamic loading Colin Lord
2016-07-06 2:41 ` Fam Zheng
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 02/32] blockdev: Add dynamic generation of module_block.h Colin Lord
2016-07-06 13:17 ` Max Reitz
2016-07-06 16:49 ` Colin Lord
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 03/32] blockdev: Add dynamic module loading for block drivers Colin Lord
2016-07-06 14:01 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 04/32] blockdev: Move bochs probe into separate file Colin Lord
2016-07-05 15:49 ` Daniel P. Berrange
2016-07-05 20:50 ` [Qemu-devel] [Qemu-block] " John Snow
2016-07-05 21:00 ` Max Reitz [this message]
2016-07-05 21:12 ` John Snow
2016-07-06 12:39 ` Max Reitz
2016-07-06 8:24 ` Kevin Wolf
2016-07-06 16:09 ` John Snow
2016-07-07 6:36 ` Markus Armbruster
2016-07-07 15:45 ` John Snow
2016-07-07 16:01 ` [Qemu-devel] " Paolo Bonzini
2016-07-07 16:14 ` John Snow
2016-07-08 9:31 ` Kevin Wolf
2016-07-07 20:32 ` [Qemu-devel] [Qemu-block] " Colin Lord
2016-07-08 9:37 ` Kevin Wolf
2016-07-08 7:17 ` Markus Armbruster
2016-07-07 15:59 ` [Qemu-devel] " Paolo Bonzini
2016-07-06 14:19 ` Max Reitz
2016-07-06 15:41 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 05/32] blockdev: Move cloop probe to its own file Colin Lord
2016-07-06 14:33 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 06/32] blockdev: Move luks " Colin Lord
2016-07-05 15:50 ` Daniel P. Berrange
2016-07-06 14:36 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 07/32] blockdev: Move dmg " Colin Lord
2016-07-06 14:39 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 08/32] blockdev: Move parallels " Colin Lord
2016-07-06 14:46 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 09/32] blockdev: Move qcow " Colin Lord
2016-07-06 14:49 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 10/32] blockdev: Move qcow2 " Colin Lord
2016-07-06 14:50 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 11/32] blockdev: Move qed " Colin Lord
2016-07-06 15:16 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 12/32] blockdev: Move raw " Colin Lord
2016-07-06 15:17 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 13/32] blockdev: Move vdi " Colin Lord
2016-07-06 15:21 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 14/32] blockdev: Move vhdx " Colin Lord
2016-07-06 15:22 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 15/32] blockdev: Move vmdk " Colin Lord
2016-07-06 15:27 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 16/32] blockdev: Move vpc " Colin Lord
2016-07-06 15:29 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 17/32] blockdev: Separate bochs probe from its driver Colin Lord
2016-07-06 15:43 ` Max Reitz
2016-07-06 15:59 ` Max Reitz
2016-07-07 14:56 ` Colin Lord
2016-07-08 9:57 ` Kevin Wolf
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 18/32] blockdev: Separate cloop " Colin Lord
2016-07-06 16:00 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 19/32] blockdev: Separate luks " Colin Lord
2016-07-06 16:03 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 20/32] blockdev: Separate dmg " Colin Lord
2016-07-06 16:05 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 21/32] blockdev: Separate parallels " Colin Lord
2016-07-06 16:08 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 22/32] blockdev: Separate qcow " Colin Lord
2016-07-06 16:09 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 23/32] blockdev: Separate qcow2 " Colin Lord
2016-07-06 16:10 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 24/32] blockdev: Separate qed " Colin Lord
2016-07-06 16:11 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 25/32] blockdev: Separate raw " Colin Lord
2016-07-06 16:11 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 26/32] blockdev: Separate vdi " Colin Lord
2016-07-06 16:12 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 27/32] blockdev: Separate vhdx " Colin Lord
2016-07-06 16:12 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 28/32] blockdev: Separate vmdk " Colin Lord
2016-07-06 16:13 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 29/32] blockdev: Separate vpc " Colin Lord
2016-07-06 16:14 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 30/32] blockdev: Remove the .bdrv_probe field from BlockDrivers Colin Lord
2016-07-06 16:17 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 31/32] blockdev: Separate out bdrv_probe_device functions Colin Lord
2016-07-06 16:29 ` Max Reitz
2016-07-05 15:24 ` [Qemu-devel] [PATCH v3 32/32] blockdev: Remove bdrv_probe_device field from BlockDriver Colin Lord
2016-07-06 16:44 ` Max Reitz
2016-07-07 20:01 ` [Qemu-devel] [Qemu-block] [PATCH v3 00/32] Dynamic module loading for block drivers John Snow
2016-07-14 12:17 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=daeaea9d-8547-5319-7a17-a28c408bd45f@redhat.com \
--to=mreitz@redhat.com \
--cc=berrange@redhat.com \
--cc=clord@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).