From: Max Reitz <mreitz@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Max Reitz <mreitz@redhat.com>
Subject: [Qemu-devel] [PATCH 6/6] blkverify: Don't require protocol filename
Date: Thu, 21 Nov 2013 20:05:54 +0100 [thread overview]
Message-ID: <1385060754-18821-7-git-send-email-mreitz@redhat.com> (raw)
In-Reply-To: <1385060754-18821-1-git-send-email-mreitz@redhat.com>
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=blkverify). 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 <mreitz@redhat.com>
---
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 “exposing” it in the way this patch does, it becomes 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 *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.4.2
prev parent reply other threads:[~2013-11-21 19:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-21 19:05 [Qemu-devel] [PATCH 0/6] blkdebug/blkverify: Allow command-line configuration Max Reitz
2013-11-21 19:05 ` [Qemu-devel] [PATCH 1/6] blkdebug: Use errp for read_config() Max Reitz
2013-11-21 19:05 ` [Qemu-devel] [PATCH 2/6] blkdebug: Don't require sophisticated filename Max Reitz
2013-11-21 19:05 ` [Qemu-devel] [PATCH 3/6] qemu-option: Add qemu_config_parse_qdict() Max Reitz
2013-11-22 8:08 ` Fam Zheng
2013-11-22 14:05 ` Max Reitz
2013-11-21 19:05 ` [Qemu-devel] [PATCH 4/6] blkdebug: Always call read_config() Max Reitz
2013-11-21 19:05 ` [Qemu-devel] [PATCH 5/6] blkdebug: Use command-line in read_config() Max Reitz
2013-11-21 19:05 ` Max Reitz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1385060754-18821-7-git-send-email-mreitz@redhat.com \
--to=mreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).