aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2014-03-05 22:41:38 +0100
committerKevin Wolf <kwolf@redhat.com>2014-03-06 16:18:09 +0100
commit464d9f641d5a2382bd43d10ae41355edf69338b1 (patch)
tree91f9e7e903224d840c129c149520924ba75ffb38 /block
parent078896a9eeeaf7c301bbc59fc791c3331324285f (diff)
block/raw-posix: Strip "file:" prefix on creation
The bdrv_create() implementation of the block/raw-posix "file" protocol driver should strip the "file:" prefix from filenames if present. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/raw-posix.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/raw-posix.c b/block/raw-posix.c
index 892145ce08..e6b4c1fe02 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -1241,6 +1241,8 @@ static int raw_create(const char *filename, QEMUOptionParameter *options,
int result = 0;
int64_t total_size = 0;
+ strstart(filename, "file:", &filename);
+
/* Read out options */
while (options && options->name) {
if (!strcmp(options->name, BLOCK_OPT_SIZE)) {