qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Can I only commit from active image to corresponding ra


From: Markus Armbruster
Subject: Re: [Qemu-devel] Can I only commit from active image to corresponding range of its backing file by qemu cmd?
Date: Sat, 22 Sep 2018 07:52:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Eric Blake <address@hidden> writes:

> On 9/21/18 9:10 AM, Markus Armbruster wrote:
>> Eric Blake <address@hidden> writes:
>>
>>> [adding Markus, because of an interesting observation about
>>> --image-opts vs. JSON null - search for [1] below]
>>
>> There are four instances of [1], and my eyes glazed over before I
>> reached the first.  May I have a summary of the interesting observation?
>>
>
> My command line marked [1] was:
> $ qemu-io -c 'discard 0 1m' --image-opts
> driver=qcow2,backing=,file.driver=file,file.filename=img.003
> warning: Use of "backing": "" is deprecated; use "backing": null instead
>
> I wanted to specifically treat a qcow2 file that has a backing file in
> its metadata as temporarily having no backing file, so I had to
> override the backing file on the command line. Since I used dotted-key
> syntax, I couldn't spell it 'backing=null' (because that would try to
> find a node named "null", rather than treating 'null' as a JSON object
> different from a string), so I had to use 'backing=' with an empty
> string, which triggers a deprecation warning.
>
> I also tried:
>
> $ qemu-io -c 'discard 0 1m' --image-opts '{"driver":"qcow2",
> "backing":null, "file":{"driver":"file", "filename":"img.003"}}'
>
> except THAT doesn't work yet (we haven't converted all our command
> line arguments to taking JSON yet; --image-opts is one of those that
> does not yet understand leading '{' as meaning a JSON parse instead of
> a dotted-key parse).
>
> Then Max figured out that we can do:
>
> $ qemu-io -c 'discard 0 1m' \
>     "json:{'driver':'qcow2','backing':null,
>            'file':{'driver':'file','filename':'img.003'}}"
>
> But I thought you'd be interested in that, since we ARE trying to make
> the command line more uniform (and convert to allowing JSON syntax in
> more spots without having to use the block layer "json:{}"
> pseudo-protocol), and as a justification for an example of where we
> either need to document that dotted-key syntax can't do everything
> (and in those cases you have to use JSON), or else come up with the
> syntactic sugar to let dotted-key pass in a null without triggering
> the warning of an empty string being deprecated in favor of an actual
> null.

Got it now.

The message

    warning: Use of "backing": "" is deprecated; use "backing": null instead

assumes JSON input.  It's just fine for QMP, which is what we had in
mind when we added it.  It's bad for dotted keys input.  It would be bad
even if dotted keys could do null values.  This is a pretty pervasive
issue.  Common problem when the input language is translated to another
language before errors get checked.  No good solution in sight, I'm
afraid.

You're right in that we want to support the same configuration language
(QAPI/JSON) everywhere.  This will take time.

We could try to suppress the warning for non-JSON input as a stop gap.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]