From: Kashyap Chamarthy <kchamart@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Adding an overlay with 'blockdev-add' fails with: "Parameter 'driver' is missing"
Date: Fri, 24 Feb 2017 11:53:12 +0100 [thread overview]
Message-ID: <20170224105312.7lephvjbipszrb3p@eukaryote> (raw)
In-Reply-To: <36a8c750-8490-1c5d-ca12-cc2b8c594334@redhat.com>
On Thu, Feb 23, 2017 at 10:51:38AM -0600, Eric Blake wrote:
> On 02/23/2017 10:33 AM, Kashyap Chamarthy wrote:
[...]
> > I tried to come up with the below JSON, after looking at the QAPI schema
> > documentation (from qemu/qapi/block-core.json), still I seem to be
> > tripping up somewhere. Now it doesn't recognize the 'backing' option:
> >
> > $ socat UNIX:./qmp-sock READLINE,history=$HOME/.qmp_history,prompt='QMP> '
> > [...]
> > QMP> {
> > QMP> "execute":"blockdev-add",
> > QMP> "arguments":{
> > QMP> "driver":"qcow2",
> > QMP> "node-name":"node1"
> > QMP> },
>
> Oops, you ended your arguments too soon.
Sigh, that was a stray closing bracket that I didn't clean up (it was
part of the "cache" section that I borrowed from the schema docs).
> > QMP> "file":{
> > QMP> "driver":"file",
> > QMP> "filename":"/export/target.qcow2"
> > QMP> },
> > QMP> "backing":{
>
> Here, you passed "file" and "backing" as siblings of "execute", but they
> should be children of "arguments".
Oops, you're right.
[...]
> Try (untested on my end) this rewrite of your original post (just
> removing the '"options":{' and corresponding '}' from that listing):
>
> {
> "execute": "blockdev-add",
> "arguments": {
> "backing": "virtio0",
> "driver": "qcow2",
> "id": "virtio1",
> "file": {
> "driver": "file",
> "filename": "/export/target.qcow2"
> }
> }
> }
This does not work (tested), because my current QEMU build from Git,
will reject the "id" key (Kevin mentioned so on IRC, but I couldn't
find the relevant Git commit from my `grep`ing in the Git history):
{"error": {"class": "GenericError", "desc": "QMP input object member 'id' is unexpected"}}
> or this attempt at your current post:
>
> { "execute":"blockdev-add",
> "arguments":{
> "driver":"qcow2",
> "node-name":"node1"
A comma missing here :-) With that fixed, it returns success.
However, bizzarely enough, when I ran `query-block` after `blockdev-add`
succeeded (well, at least after it returned success), I don't see the
new node ('target.qcow2') reflected in the return output. Me
investigates.
https://kashyapc.fedorapeople.org/virt/temp/blockdev-add-followed-by-buggy-query-block.txt
> "file":{
> "driver":"file",
> "filename":"/export/target.qcow2"
> },
> "backing":{
> "driver":"qcow2",
> "file":{
> "driver":"file",
> "filename":"/export/base.qcow2"
> }
> }
> }
> }
Just for completeness, the new working incantation (that removes the
need for "options" indirection, and the "id" key) that takes
'node-name':
--------------------------------------------
{
"execute":"blockdev-add",
"arguments":{
"driver":"qcow2",
"node-name":"node1",
"file":{
"driver":"file",
"filename":"/export/target.qcow2"
},
"backing":{
"driver":"qcow2",
"file":{
"driver":"file",
"filename":"/export/base.qcow2"
}
}
}
}
--------------------------------------------
--
/kashyap
next prev parent reply other threads:[~2017-02-24 10:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-23 14:40 [Qemu-devel] Adding an overlay with 'blockdev-add' fails with: "Parameter 'driver' is missing" Kashyap Chamarthy
2017-02-23 15:11 ` Markus Armbruster
2017-02-23 16:33 ` Kashyap Chamarthy
2017-02-23 16:51 ` Eric Blake
2017-02-24 10:53 ` Kashyap Chamarthy [this message]
2017-02-24 11:43 ` Kashyap Chamarthy
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=20170224105312.7lephvjbipszrb3p@eukaryote \
--to=kchamart@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).