qemu-block
[Top][All Lists]
Advanced

[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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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