From: Jonathon Jongsma <jjongsma@redhat.com>
To: Markus Armbruster <armbru@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
qemu-block@nongnu.org, Hanna Reitz <hreitz@redhat.com>,
sgarzare@redhat.com
Subject: Re: [PATCH v3 1/1] block/blkio: use qemu_open() to support fd passing for virtio-blk
Date: Thu, 25 May 2023 13:59:13 -0500 [thread overview]
Message-ID: <ce1b4fc7-0e8e-55e0-c8c3-99a69296a3ec@redhat.com> (raw)
In-Reply-To: <87edn4i7ro.fsf@pond.sub.org>
On 5/25/23 1:30 PM, Markus Armbruster wrote:
> Stefan Hajnoczi <stefanha@redhat.com> writes:
>
>> On Wed, May 17, 2023 at 09:19:26AM +0200, Stefano Garzarella wrote:
>>> CCing Markus for some advice.
>>>
>>> On Tue, May 16, 2023 at 11:04:21AM -0500, Jonathon Jongsma wrote:
>
> [...]
>
>>>> I need some way to determine that the particular qemu binary can accept
>>>> a /dev/fdset/ path for vdpa block devices. libvirt uses a variety of
>>>> methods to determine capabilities for a given qemu binary, including
>>>> querying the qmp schema, commands, object types, specific device/object
>>>> properties, etc. For example, right now I can determine (via querying
>>>> the qmp schema) whether virtio-blk-vhost-vdpa is a valid type for the
>>>> blockdev-add command by querying the qmp schema. I need something more
>>>> than that but I'm not sure how to do it without introducing a separate
>>>> 'fd' parameter. Any ideas?
>>>
>>> The only thing I can think of is to make a mix between v2 and v3. I mean add
>>> both the new `fd` parameter, and support qemu_open() on `path`.
>>>
>>> That way libvirt (or other users) can check that fd passing is supported and
>>> use `fd` or fdset with `path`.
>>>
>>> Obviously I would have liked to implement only one of the two methods, but
>>> if this helps, maybe it makes sense to support both.
>>>
>>> What do you think?
>>
>> Markus: Is a preferred way to make this new path handling behavior
>> introspectable? I vaguely remember a way for QMP clients to query
>> strings that describe QMP behavior that's not otherwise
>> introspectable...
>
> Let me try to answer this without first reading the entire thread.
>
> QMP introspection lets you find out things like whether a command is
> there, or whether an an argument is there, and what its type is.
> Suffices most of the time.
>
> However, behavior can certainly change while the introspection data
> remains the same. When a management application needs to know about the
> change, we better expose the change in introspection somehow.
>
> The "obvious" way to do that would be some arbitrary change that *is*
> visible in introspection. Meh.
>
> The modern way is to add a suitable "feature".
> docs/devel/qapi-code-gen.rst:
>
> Features
> --------
>
> Syntax::
>
> FEATURES = [ FEATURE, ... ]
> FEATURE = STRING
> | { 'name': STRING, '*if': COND }
>
> Sometimes, the behaviour of QEMU changes compatibly, but without a
> change in the QMP syntax (usually by allowing values or operations
> that previously resulted in an error). QMP clients may still need to
> know whether the extension is available.
>
> For this purpose, a list of features can be specified for definitions,
> enumeration values, and struct members. Each feature list member can
> either be ``{ 'name': STRING, '*if': COND }``, or STRING, which is
> shorthand for ``{ 'name': STRING }``.
>
> The optional 'if' member specifies a conditional. See `Configuring
> the schema`_ below for more on this.
>
> Example::
>
> { 'struct': 'TestType',
> 'data': { 'number': 'int' },
> 'features': [ 'allow-negative-numbers' ] }
>
> The feature strings are exposed to clients in introspection, as
> explained in section `Client JSON Protocol introspection`_.
>
> Intended use is to have each feature string signal that this build of
> QEMU shows a certain behaviour.
>
> For a real example, see commit c6bdc312f30 (qapi: Add
> '@allow-write-only-overlay' feature for 'blockdev-snapshot').
>
> Does this answer your question?
>
That sounds perfect for libvirt's needs.
Jonathon
next prev parent reply other threads:[~2023-05-25 18:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-11 9:15 [PATCH v3 0/1] block/blkio: support 'fd' option for virtio-blk-vhost-vdpa driver Stefano Garzarella
2023-05-11 9:15 ` [PATCH v3 1/1] block/blkio: use qemu_open() to support fd passing for virtio-blk Stefano Garzarella
2023-05-11 16:03 ` Jonathon Jongsma
2023-05-15 10:10 ` Stefano Garzarella
2023-05-16 16:04 ` Jonathon Jongsma
2023-05-17 7:19 ` Stefano Garzarella
2023-05-17 14:30 ` Stefan Hajnoczi
2023-05-24 9:05 ` Stefano Garzarella
2023-05-24 19:16 ` Stefan Hajnoczi
2023-05-25 18:30 ` Markus Armbruster
2023-05-25 18:59 ` Jonathon Jongsma [this message]
2023-05-26 14:25 ` Stefano Garzarella
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=ce1b4fc7-0e8e-55e0-c8c3-99a69296a3ec@redhat.com \
--to=jjongsma@redhat.com \
--cc=armbru@redhat.com \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.com \
--cc=stefanha@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).