Patchwork [v3,15/21] blkdebug: Make filename optional

login
register
mail settings
Submitter Max Reitz
Date Dec. 11, 2013, 6:11 p.m.
Message ID <1386785473-26157-16-git-send-email-mreitz@redhat.com>
Download mbox | patch
Permalink /patch/300256/
State New
Headers show

Comments

Max Reitz - Dec. 11, 2013, 6:11 p.m.
There is no problem in giving no filename; in this case, it has to be
specified through the "image" option.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block/blkdebug.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/block/blkdebug.c b/block/blkdebug.c
index b032fff..6b59216 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -327,8 +327,10 @@  static void blkdebug_parse_filename(const char *filename, QDict *options,
     /* Parse the blkdebug: prefix */
     if (!strstart(filename, "blkdebug:", &filename)) {
         /* There was no prefix; therefore, all options have to be already
-           present in the QDict (except for the filename) */
-        qdict_put(options, "x-image", qstring_from_str(filename));
+           present in the QDict; if a filename is given, pass it */
+        if (filename) {
+            qdict_put(options, "x-image", qstring_from_str(filename));
+        }
         return;
     }