From: Max Reitz Date: Wed, 5 Mar 2014 21:41:38 +0000 (+0100) Subject: block/raw-posix: Strip "file:" prefix on creation X-Git-Tag: v2.0.0-rc0~33^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=464d9f641d5a2382bd43d10ae41355edf69338b1;p=thirdparty%2Fqemu.git 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 --- diff --git a/block/raw-posix.c b/block/raw-posix.c index 892145ce086..e6b4c1fe025 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)) {