From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjZuM-00048x-SY for qemu-devel@nongnu.org; Thu, 21 Nov 2013 14:27:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VjZuF-0005E2-Fp for qemu-devel@nongnu.org; Thu, 21 Nov 2013 14:27:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6327) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjZuF-0005Dc-6x for qemu-devel@nongnu.org; Thu, 21 Nov 2013 14:27:15 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rALJREeT002641 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 21 Nov 2013 14:27:14 -0500 From: Max Reitz Date: Thu, 21 Nov 2013 20:05:54 +0100 Message-Id: <1385060754-18821-7-git-send-email-mreitz@redhat.com> In-Reply-To: <1385060754-18821-1-git-send-email-mreitz@redhat.com> References: <1385060754-18821-1-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 6/6] blkverify: Don't require protocol filename List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , 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 option (like file.driver=3Dblkverify). Contrary to the current reaction, this is not really a problem; the whole filename just has to be stored (in the x-image option) and the user has to manually specify the x-raw option. Signed-off-by: Max Reitz --- The x-raw option is undocumented and may be removed at any point in time; but I don't see a reason why this should happen. Passing the reference filename through an option maybe was a bit dirty in the past; but by =E2=80=9Cexposing=E2=80=9D it in the way this patch does, it becom= es probably the only clean solution. The only problem I can see right now is the naming of the option, but we should always be able to leave it as an alias, if necessary. --- block/blkverify.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/blkverify.c b/block/blkverify.c index 3c63528..bdbdd68 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -78,7 +78,9 @@ static void blkverify_parse_filename(const char *filena= me, QDict *options, =20 /* 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 alread= y + present in the QDict (except for the filename) */ + qdict_put(options, "x-image", qstring_from_str(filename)); return; } =20 --=20 1.8.4.2