diff mbox

[PULL,11/19] block/raw-posix: Strip "file:" prefix on creation

Message ID 1394199187-9576-12-git-send-email-kwolf@redhat.com
State New
Headers show

Commit Message

Kevin Wolf March 7, 2014, 1:32 p.m. UTC
From: Max Reitz <mreitz@redhat.com>

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 | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/block/raw-posix.c b/block/raw-posix.c
index 892145c..e6b4c1f 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)) {