From: Thomas Huth <thuth@linux.vnet.ibm.com>
To: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>
Cc: kwolf@redhat.com, dahi@linux.vnet.ibm.com,
Public KVM Mailing List <qemu-devel@nongnu.org>,
armbru@redhat.com, mihajlov@linux.vnet.ibm.com,
borntraeger@de.ibm.com, stefanha@redhat.com,
cornelia.huck@de.ibm.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 3/5] block: Add driver methods to probe blocksizes and geometry
Date: Thu, 11 Dec 2014 15:22:58 +0100 [thread overview]
Message-ID: <20141211152258.667a567f@oc7435384737.ibm.com> (raw)
In-Reply-To: <54897D41.5090106@linux.vnet.ibm.com>
On Thu, 11 Dec 2014 14:17:21 +0300
Ekaterina Tumanova <tumanova@linux.vnet.ibm.com> wrote:
> On 12/10/2014 04:14 PM, Thomas Huth wrote:
> > On Fri, 5 Dec 2014 18:56:19 +0100
> > Ekaterina Tumanova <tumanova@linux.vnet.ibm.com> wrote:
...
> >> diff --git a/block/raw_bsd.c b/block/raw_bsd.c
> >> index 401b967..cfd5249 100644
> >> --- a/block/raw_bsd.c
> >> +++ b/block/raw_bsd.c
> >> @@ -173,6 +173,18 @@ static int raw_probe(const uint8_t *buf, int buf_size, const char *filename)
> >> return 1;
> >> }
> >>
> >> +static int raw_probe_blocksizes(BlockDriverState *bs, BlockSizes *bsz)
> >> +{
> >> + bdrv_probe_blocksizes(bs->file, bsz);
> >> +
> >> + return 0;
> >> +}
> >> +
> >> +static int raw_probe_geometry(BlockDriverState *bs, hdGeometry *geo)
> >> +{
> >> + return bdrv_probe_geometry(bs->file, geo);
> >> +}
> >> +
> >> static BlockDriver bdrv_raw = {
> >> .format_name = "raw",
> >> .bdrv_probe = &raw_probe,
> >> @@ -190,6 +202,8 @@ static BlockDriver bdrv_raw = {
> >> .has_variable_length = true,
> >> .bdrv_get_info = &raw_get_info,
> >> .bdrv_refresh_limits = &raw_refresh_limits,
> >> + .bdrv_probe_blocksizes = &raw_probe_blocksizes,
> >> + .bdrv_probe_geometry = &raw_probe_geometry,
> >> .bdrv_is_inserted = &raw_is_inserted,
> >> .bdrv_media_changed = &raw_media_changed,
> >> .bdrv_eject = &raw_eject,
> >
> > Hmmm, raw_probe_blocksizes() calls bdrv_probe_blocksizes(), but when I
> > look at your patch 1/5, bdrv_probe_blocksizes() wants to call
> > drv->bdrv_probe_blocksizes() (i.e. raw_probe_blocksizes()) again?
> > Don't you get an endless recursive loop here? Or did I miss something?
> > *confused*
> >
> > Thomas
>
> No I don't :) Because raw_probe_blocksizes indeed calls
> bdrv_probe_blocksizes() dispatcher, but it calls it against different
> driver: "bs->file". This child points to other driver, which represents
> the actual nature of the device.
>
> So the 2nd drv->bdrv_probe_blocksizes() call will actually be
> a call to either hdev_probe_blocksizes() for "host_device" driver or
> will be null for other drivers.
Ah, ok, you're right of course! Thanks for the explanation and sorry
for the confusion!
Thomas
next prev parent reply other threads:[~2014-12-11 14:23 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-05 17:56 [Qemu-devel] [PATCH v3 0/5] Geometry and blocksize detection for backing devices Ekaterina Tumanova
2014-12-05 17:56 ` [Qemu-devel] [PATCH v3 1/5] block: add bdrv functions for geometry and blocksize Ekaterina Tumanova
2014-12-10 12:38 ` Thomas Huth
2014-12-15 13:00 ` Markus Armbruster
2014-12-05 17:56 ` [Qemu-devel] [PATCH v3 2/5] raw-posix: Factor block size detection out of raw_probe_alignment() Ekaterina Tumanova
2014-12-10 12:48 ` Thomas Huth
2014-12-15 13:07 ` Markus Armbruster
2014-12-05 17:56 ` [Qemu-devel] [PATCH v3 3/5] block: Add driver methods to probe blocksizes and geometry Ekaterina Tumanova
2014-12-10 13:14 ` Thomas Huth
2014-12-11 11:17 ` Ekaterina Tumanova
2014-12-11 14:22 ` Thomas Huth [this message]
2014-12-15 13:29 ` Markus Armbruster
2014-12-15 14:36 ` Ekaterina Tumanova
2014-12-05 17:56 ` [Qemu-devel] [PATCH v3 4/5] block-backend: Add wrappers for blocksizes and geometry probing Ekaterina Tumanova
2014-12-05 17:56 ` [Qemu-devel] [PATCH v3 5/5] BlockConf: Call backend functions to detect geometry and blocksizes Ekaterina Tumanova
2014-12-10 13:29 ` Thomas Huth
2014-12-15 13:50 ` Markus Armbruster
2014-12-15 14:40 ` Ekaterina Tumanova
2014-12-15 15:48 ` Markus Armbruster
2014-12-12 13:10 ` [Qemu-devel] [PATCH v3 0/5] Geometry and blocksize detection for backing devices Ekaterina Tumanova
2014-12-15 13:51 ` Markus Armbruster
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=20141211152258.667a567f@oc7435384737.ibm.com \
--to=thuth@linux.vnet.ibm.com \
--cc=armbru@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=dahi@linux.vnet.ibm.com \
--cc=kwolf@redhat.com \
--cc=mihajlov@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=tumanova@linux.vnet.ibm.com \
/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).