All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-block@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, Eric Blake <eblake@redhat.com>
Subject: Re: [Qemu-devel] [RFC 0/7] block: Try to use correctly typed blockdev options
Date: Fri, 4 May 2018 18:11:13 +0200	[thread overview]
Message-ID: <b83088e2-13d0-eada-59c0-6fc48fe18c87@redhat.com> (raw)
In-Reply-To: <2efd29b6-de41-2896-7a9f-021e12214f0e@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1932 bytes --]

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2018-05-04 16:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02 21:32 [Qemu-devel] [RFC 0/7] block: Try to use correctly typed blockdev options Max Reitz
2018-05-02 21:32 ` [Qemu-devel] [RFC 1/7] qdict: Add qdict_set_default_bool() Max Reitz
2018-05-02 21:32 ` [Qemu-devel] [RFC 2/7] block: Let change-medium add detect-zeroes as bool Max Reitz
2018-05-02 21:32 ` [Qemu-devel] [RFC 3/7] block: Make use of qdict_set_default_bool() Max Reitz
2018-05-02 21:32 ` [Qemu-devel] [RFC 4/7] block: Add bdrv_open_string_opts() Max Reitz
2018-05-02 21:32 ` [Qemu-devel] [RFC 5/7] block: Add blk_new_open_string_opts() Max Reitz
2018-05-02 21:32 ` [Qemu-devel] [RFC 6/7] block: Use {blk_new, bdrv}_open_string_opts() Max Reitz
2018-05-02 21:32 ` [Qemu-devel] [RFC 7/7] iotests: Test internal option typing Max Reitz
2018-05-02 21:36 ` [Qemu-devel] [Qemu-block] [RFC 0/7] block: Try to use correctly typed blockdev options Max Reitz
2018-05-03  8:16 ` [Qemu-devel] " Markus Armbruster
2018-05-04 15:53   ` Max Reitz
2018-05-04 16:11     ` Max Reitz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b83088e2-13d0-eada-59c0-6fc48fe18c87@redhat.com \
    --to=mreitz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.