From 464d9f641d5a2382bd43d10ae41355edf69338b1 Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Wed, 5 Mar 2014 22:41:38 +0100 Subject: 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 Reviewed-by: Eric Blake Reviewed-by: Benoit Canet Signed-off-by: Kevin Wolf --- block/raw-posix.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'block') 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)) { -- cgit v1.2.1