From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52691) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6kU5-0001w2-Lz for qemu-devel@nongnu.org; Fri, 24 Jan 2014 12:24:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W6kTz-0007md-N7 for qemu-devel@nongnu.org; Fri, 24 Jan 2014 12:24:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41155) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6kTz-0007mQ-FR for qemu-devel@nongnu.org; Fri, 24 Jan 2014 12:23:55 -0500 From: Kevin Wolf Date: Fri, 24 Jan 2014 18:21:17 +0100 Message-Id: <1390584136-24703-35-git-send-email-kwolf@redhat.com> In-Reply-To: <1390584136-24703-1-git-send-email-kwolf@redhat.com> References: <1390584136-24703-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 34/93] blkverify: Don't require protocol filename List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Max Reitz If the filename is not prefixed by "blkverify:" in blkverify_parse_filename(), the blkverify driver was not selected through that protocol prefix, but by an explicit command line (or QMP) option (like driver=blkverify). If blkverify_parse_filename() has been called, a filename has been given. If it is not prefixed, it is probably really just a plain filename. This is no problem, since we can use it as the test image filename and rely on the user to specify the raw image filename through the new corresponding option. Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf --- block/blkverify.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/blkverify.c b/block/blkverify.c index dc14290..a2e8f5f 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -78,7 +78,9 @@ static void blkverify_parse_filename(const char *filename, QDict *options, /* Parse the blkverify: prefix */ if (!strstart(filename, "blkverify:", &filename)) { - error_setg(errp, "File name string must start with 'blkverify:'"); + /* 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)); return; } -- 1.8.1.4