qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Max Reitz <mreitz@redhat.com>
Cc: "Kevin Wolf" <kwolf@redhat.com>,
	"Benoît Canet" <benoit.canet@irqsave.net>,
	qemu-devel@nongnu.org, "Stefan Hajnoczi" <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 0/5] block: Strip protocol prefixes from filenames
Date: Wed, 12 Mar 2014 11:03:37 +0100	[thread overview]
Message-ID: <20140312100337.GA26000@stefanha-thinkpad.muc.redhat.com> (raw)
In-Reply-To: <1394235585-10500-1-git-send-email-mreitz@redhat.com>

On Sat, Mar 08, 2014 at 12:39:40AM +0100, Max Reitz wrote:
> As some kind of follow-up to the "block: Strip 'file:' prefix from
> filenames" series, this series does the same thing for other protocol
> drivers.
> 
> All protocol drivers which implement bdrv_probe() may rely on them being
> selected based on that function returning success alone. However, they
> may have been chosen through a protocol prefix as well. Thus, if they
> currently do not implement bdrv_parse_filename(), they may be unaware of
> that possible prefix and therefore fail to interpret such filenames
> (and, in fact, all of those are unaware).
> 
> This series makes these drivers strip their respective prefix through
> bdrv_parse_filename() and in bdrv_create(), if implemented.
> 
> The following protocol drivers are not touched by this series since they
> already implement bdrv_parse_filename() and are thus very likely aware
> of the prefix:
>  - vvfat, nbd, blkdebug, blkverify, ssh, curl
> 
> The following protocol drivers are not touched by this series since they
> do not implement bdrv_probe() and therefore always receive a prefixed
> filename (unless they are selected through QMP options) which makes them
> pretty much guaranteed to handle these prefixes correctly:
>  - nfs, sheepdog, rbd, quorum, gluster, iscsi
> 
> Thus, only drivers implementing bdrv_probe() and not implementing
> bdrv_parse_filename() have been touched.
> 
> 
> Please note that this series does not strip the prefix in bdrv_probe().
> This is due to the driver being selected anyway later on through the
> protocol prefix, even though bdrv_probe() returned 0. More importantly,
> according to a comment in bdrv_find_protocol() in block.c about why
> bdrv_probe() occurs before the protocol prefix is interpreted, it seems
> actually more desirable not to strip the prefix in bdrv_probe() (since
> it may in fact not be a prefix but rather some obscure device naming
> schema).
> 
> 
> v2:
>  - Patch 3: Use a common cdrom_parse_filename() for both Linux and
>             FreeBSD [Benoît]
>  - Patch 4: Fixed commit message [Eric]
> 
> 
> 
> Key:
> [----] : patches are identical
> [####] : number of functional differences between upstream/downstream patch
> [down] : patch is downstream-only
> The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively
> 
> 001/5:[----] [--] 'block/raw-posix: bdrv_parse_filename() for hdev'
> 002/5:[----] [--] 'block/raw-posix: bdrv_parse_filename() for floppy'
> 003/5:[0013] [FC] 'block/raw-posix: bdrv_parse_filename() for cdrom'
> 004/5:[----] [--] 'block/raw-posix: Strip protocol prefix on creation'
> 005/5:[----] [--] 'block/raw-win32: bdrv_parse_filename() for hdev'
> 
> 
> 
> Max Reitz (5):
>   block/raw-posix: bdrv_parse_filename() for hdev
>   block/raw-posix: bdrv_parse_filename() for floppy
>   block/raw-posix: bdrv_parse_filename() for cdrom
>   block/raw-posix: Strip protocol prefix on creation
>   block/raw-win32: bdrv_parse_filename() for hdev
> 
>  block/raw-posix.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
>  block/raw-win32.c | 10 ++++++++++
>  2 files changed, 57 insertions(+)
> 
> -- 
> 1.9.0
> 
> 

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

      parent reply	other threads:[~2014-03-12 10:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-07 23:39 [Qemu-devel] [PATCH v2 0/5] block: Strip protocol prefixes from filenames Max Reitz
2014-03-07 23:39 ` [Qemu-devel] [PATCH v2 1/5] block/raw-posix: bdrv_parse_filename() for hdev Max Reitz
2014-03-07 23:39 ` [Qemu-devel] [PATCH v2 2/5] block/raw-posix: bdrv_parse_filename() for floppy Max Reitz
2014-03-07 23:39 ` [Qemu-devel] [PATCH v2 3/5] block/raw-posix: bdrv_parse_filename() for cdrom Max Reitz
2014-03-09 12:13   ` Benoît Canet
2014-03-07 23:39 ` [Qemu-devel] [PATCH v2 4/5] block/raw-posix: Strip protocol prefix on creation Max Reitz
2014-03-07 23:39 ` [Qemu-devel] [PATCH v2 5/5] block/raw-win32: bdrv_parse_filename() for hdev Max Reitz
2014-03-12 10:03 ` Stefan Hajnoczi [this message]

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=20140312100337.GA26000@stefanha-thinkpad.muc.redhat.com \
    --to=stefanha@gmail.com \
    --cc=benoit.canet@irqsave.net \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).