qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/5] block: Strip protocol prefixes from filenames
@ 2014-03-06 22:25 Max Reitz
  2014-03-06 22:25 ` [Qemu-devel] [PATCH 1/5] block/raw-posix: bdrv_parse_filename() for hdev Max Reitz
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Max Reitz @ 2014-03-06 22:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Benoît Canet, Stefan Hajnoczi, Max Reitz

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).


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 | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 block/raw-win32.c | 10 ++++++++++
 2 files changed, 62 insertions(+)

-- 
1.9.0

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-03-06 23:58 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-06 22:25 [Qemu-devel] [PATCH 0/5] block: Strip protocol prefixes from filenames Max Reitz
2014-03-06 22:25 ` [Qemu-devel] [PATCH 1/5] block/raw-posix: bdrv_parse_filename() for hdev Max Reitz
2014-03-06 22:38   ` Benoît Canet
2014-03-06 22:25 ` [Qemu-devel] [PATCH 2/5] block/raw-posix: bdrv_parse_filename() for floppy Max Reitz
2014-03-06 22:38   ` Benoît Canet
2014-03-06 22:25 ` [Qemu-devel] [PATCH 3/5] block/raw-posix: bdrv_parse_filename() for cdrom Max Reitz
2014-03-06 22:37   ` Benoît Canet
2014-03-06 22:39     ` Max Reitz
2014-03-06 22:25 ` [Qemu-devel] [PATCH 4/5] block/raw-posix: Strip protocol prefix on creation Max Reitz
2014-03-06 22:45   ` Benoît Canet
2014-03-06 23:58   ` Eric Blake
2014-03-06 22:27 ` Max Reitz
2014-03-06 22:27   ` [Qemu-devel] [PATCH 5/5] block/raw-win32: bdrv_parse_filename() for hdev Max Reitz
2014-03-06 22:47     ` Benoît Canet
2014-03-06 22:37   ` [Qemu-devel] [PATCH 4/5] block/raw-posix: Strip protocol prefix on creation Max Reitz

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).