From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNg0p-0007ti-JT for qemu-devel@nongnu.org; Wed, 12 Mar 2014 06:03:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNg0k-0003iG-8G for qemu-devel@nongnu.org; Wed, 12 Mar 2014 06:03:47 -0400 Received: from mail-ee0-x234.google.com ([2a00:1450:4013:c00::234]:63329) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNg0k-0003i8-0r for qemu-devel@nongnu.org; Wed, 12 Mar 2014 06:03:42 -0400 Received: by mail-ee0-f52.google.com with SMTP id e49so4226048eek.11 for ; Wed, 12 Mar 2014 03:03:41 -0700 (PDT) Date: Wed, 12 Mar 2014 11:03:37 +0100 From: Stefan Hajnoczi Message-ID: <20140312100337.GA26000@stefanha-thinkpad.muc.redhat.com> References: <1394235585-10500-1-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1394235585-10500-1-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 0/5] block: Strip protocol prefixes from filenames List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , =?iso-8859-1?Q?Beno=EEt?= Canet , qemu-devel@nongnu.org, Stefan Hajnoczi 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