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>
This commit is contained in:
Max Reitz 2014-03-05 22:41:38 +01:00 committed by Kevin Wolf
parent 078896a9ee
commit 464d9f641d
1 changed files with 2 additions and 0 deletions

View File

@ -1241,6 +1241,8 @@ static int raw_create(const char *filename, QEMUOptionParameter *options,
int result = 0; int result = 0;
int64_t total_size = 0; int64_t total_size = 0;
strstart(filename, "file:", &filename);
/* Read out options */ /* Read out options */
while (options && options->name) { while (options && options->name) {
if (!strcmp(options->name, BLOCK_OPT_SIZE)) { if (!strcmp(options->name, BLOCK_OPT_SIZE)) {