[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [RFC 0/7] block: Try to use correctly type
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [Qemu-devel] [RFC 0/7] block: Try to use correctly typed blockdev options |
Date: |
Fri, 4 May 2018 18:11:13 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
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
- [Qemu-block] [RFC 1/7] qdict: Add qdict_set_default_bool(), (continued)
- [Qemu-block] [RFC 1/7] qdict: Add qdict_set_default_bool(), Max Reitz, 2018/05/02
- [Qemu-block] [RFC 2/7] block: Let change-medium add detect-zeroes as bool, Max Reitz, 2018/05/02
- [Qemu-block] [RFC 4/7] block: Add bdrv_open_string_opts(), Max Reitz, 2018/05/02
- [Qemu-block] [RFC 3/7] block: Make use of qdict_set_default_bool(), Max Reitz, 2018/05/02
- [Qemu-block] [RFC 5/7] block: Add blk_new_open_string_opts(), Max Reitz, 2018/05/02
- [Qemu-block] [RFC 6/7] block: Use {blk_new, bdrv}_open_string_opts(), Max Reitz, 2018/05/02
- [Qemu-block] [RFC 7/7] iotests: Test internal option typing, Max Reitz, 2018/05/02
- Re: [Qemu-block] [RFC 0/7] block: Try to use correctly typed blockdev options, Max Reitz, 2018/05/02
- Re: [Qemu-block] [Qemu-devel] [RFC 0/7] block: Try to use correctly typed blockdev options, Markus Armbruster, 2018/05/03