On 2018-05-04 17:53, Max Reitz wrote: [...]
> So if you use it the "proper" way:
>
> $ x86_64-softmmu/qemu-system-x86_64 -nodefaults \
> -drive if=none,driver=raw,file=blkdebug::null-co://,file.align=512 \
> -monitor stdio
> QEMU 2.12.50 monitor - type 'help' for more information
> (qemu) info block
> none0 (#block238): json:{"driver": "raw", "file": {"image": {"driver":
> "null-co"}, "driver": "blkdebug", "align": "512"}} (raw)
>
> Well... Looks like the same issue, but it's different, actually.
> blkdebug_parse_filename() only adds "x-image" after the conversion to
> BlockdevOptions and back, so that can't be the thing that breaks the
> conversion here. No, the thing here is the "filename" option which is
> not something that blkdebug supports according to the QAPI schema...
[...]
> Option 3: Keep doing what this series did. Find out why "filename" is
> an option in the QDict in the first place, because I would have assumed
> that you need to specify it as the @filename parameter of bdrv_open()
> instead of through the QDict.
Solved the mystery. The issue isn't "filename" in the QDict (it
actually isn't there), but the fact that -drive allows you to leave out
so many essential options. In the above command line, for instance, I
left out file.driver and file.image.driver. Both are derived by
bdrv_open(), but are not set at the point where I'm trying to do the typing.
(And this gets better with something like -drive file=foo.img where even
file.filename needs to be derived. Or -drive file=nbd://localhost,
where it's not even file.filename but file.server.*, which comes from
nbd_parse_filename()...)
Sooo... Guess I'll go to option #1.
(And in the long run, I suppose we need to pull out the whole
"derivation infrastructure" which includes probing and
bdrv_parse_filename() and do the conversion to BlockdevOptions afterwards.)
Max
signature.asc
Description: OpenPGP digital signature
