]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
block/raw-posix: Strip "file:" prefix on creation
authorMax Reitz <mreitz@redhat.com>
Wed, 5 Mar 2014 21:41:38 +0000 (22:41 +0100)
committerKevin Wolf <kwolf@redhat.com>
Thu, 6 Mar 2014 15:18:09 +0000 (16:18 +0100)
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>
block/raw-posix.c

index 892145ce086450d08c46c6d94a8ac1515a54b6da..e6b4c1fe02534130eab899b3b6b231aba3c24041 100644 (file)
@@ -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)) {