qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 0/5] block: Strip protocol prefixes from filenames


From: Max Reitz
Subject: [Qemu-devel] [PATCH 0/5] block: Strip protocol prefixes from filenames
Date: Thu, 6 Mar 2014 23:25:34 +0100

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]