On 2017-11-10 23:22, Eric Blake wrote:
> On 11/10/2017 04:13 PM, Max Reitz wrote:
>> Instead of converting all "backing": null instances into "backing": "",
>> handle a null value directly in bdrv_open_inherit().
>>
>> This enables explicitly null backing links for json:{} filenames.
>>
>> Signed-off-by: Max Reitz <mre...@redhat.com>
>> ---
>>  block.c                    |  2 +-
>>  blockdev.c                 | 14 --------------
>>  tests/qemu-iotests/089     | 20 ++++++++++++++++++++
>>  tests/qemu-iotests/089.out |  8 ++++++++
>>  4 files changed, 29 insertions(+), 15 deletions(-)
>>
> 
>> @@ -3899,19 +3898,6 @@ void qmp_blockdev_add(BlockdevOptions *options, Error 
>> **errp)
>>  
>>      qdict_flatten(qdict);
>>  
>> -    /*
>> -     * Rewrite "backing": null to "backing": ""
>> -     * TODO Rewrite "" to null instead, and perhaps not even here
>> -     */
> 
> Nice that the TODO told you what to do :)

Well, not really, because I disagree that it needs to be rewritten at
all.  I think we just need to deprecate and later disallow "backing":
"", which would absolve us from all of the rewriting trouble.

This code was added here because Markus needed to allow "backing": null
in a hurry (as far as I remember), so he added it centrally here instead
of checking how many places there are that evaluate "backing": "".

I should maybe have said that patch 3 is more of an RFC.  I'm not sure
whether other people agree that "backing": "" should be deprecated --
and if not, we would have to rewrite it still.

Max

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to