From: Markus Armbruster <armbru@redhat.com>
To: Zhang Chen <zhangckid@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
"Dr . David Alan Gilbert" <dave@treblig.org>,
Eric Blake <eblake@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [PATCH V4 4/4] qapi: examine IOThread attachment status via query-iothreads
Date: Wed, 25 Feb 2026 11:54:53 +0100 [thread overview]
Message-ID: <87jyw1um82.fsf@pond.sub.org> (raw)
In-Reply-To: <CAK3tnvJ=_rp-JjkrgMA6cf+WXc0oHFJeQ5CsQsLf-fEd1ikGgw@mail.gmail.com> (Zhang Chen's message of "Wed, 25 Feb 2026 18:29:29 +0800")
Zhang Chen <zhangckid@gmail.com> writes:
> On Tue, Feb 24, 2026 at 4:42 PM Markus Armbruster <armbru@redhat.com> wrote:
>>
>> Zhang Chen <zhangckid@gmail.com> writes:
>>
>> > On Tue, Feb 17, 2026 at 3:51 PM Markus Armbruster <armbru@redhat.com> wrote:
>> >>
>> >> Zhang Chen <zhangckid@gmail.com> writes:
>> >>
>> >> > Extend the 'IOThreadInfo' structure to include attachment metrics.
>> >> > This allows users to monitor how many devices are associated with
>> >> > a specific IOThread and identify them by their QOM paths.
>> >> >
>> >> > New fields added to IOThreadInfo:
>> >> > - @attached-cnt: An integer representing the number of devices
>> >> > currently using this IOThread's AioContext.
>> >> > - @attached-dev: A string containing a delimited list ("|") of
>> >> > QOM paths for the attached devices.
>> >> >
>> >> > These fields are also exposed via the Human Monitor Interface (HMP)
>> >> > command 'info iothreads' to assist with manual debugging and
>> >> > performance tuning.
>> >> >
>> >> > Example QMP output:
>> >> > {
>> >> > "id": "iothread0",
>> >> > "thread-id": 3134,
>> >> > "attached-cnt": 2,
>> >> > "attached-dev": "/machine/peripheral/blk1/virtio-backend | /machine/peripheral/blk0/virtio-backend",
>> >> > ...
>> >> > }
>> >> >
>> >> > Signed-off-by: Zhang Chen <zhangckid@gmail.com>
>> >>
>> >> [...]
>> >>
>> >> > diff --git a/qapi/misc.json b/qapi/misc.json
>> >> > index 1f5062df2a..ca53638684 100644
>> >> > --- a/qapi/misc.json
>> >> > +++ b/qapi/misc.json
>> >> > @@ -76,6 +76,19 @@
>> >> > #
>> >> > # @thread-id: ID of the underlying host thread
>> >> > #
>> >> > +# @attached-cnt: The parameter is a counter indicating how many
>> >> > +# active devices are currently associated with this iothread
>> >> > +# (e.g. virtio-blk). In hotplug scenarios, users can
>> >> > +# pre-allocate multiple iothread objects to serve as a persistent
>> >> > +# thread pool. When a device is hot-unplugged, the corresponding
>> >> > +# IOThread is released but remains available, allowing subsequent
>> >> > +# hot-plugged devices to attach to and reuse the existing thread.
>> >> > +# (since 11.0)
>> >> > +#
>> >> > +# @attached-dev: A list of QOM paths for the devices currently
>> >> > +# associated with this IOThread, delimited by " | ".
>> >> > +# Returns "none" if no devices are attached. (since 11.0)
[...]
>> >>
>> >> QAPI schema design maxim: do not encode structured data as strings.
>> >> @attached-devs should be an array of QOM paths instead.
>> >
>> > OK, will fix in next version.
>>
>> Thanks!
>>
>> >> Unless I misunderstand your docs, @attached-cnt is the number of QOM
>> >> paths in @attached-dev, i.e. @attached-dev is redundant. If this is the
>> >> case, drop it. If it isn't, educate me :)
>> >
>> > As Stefan's comments, I try to address more specific needs:
>> > https://mail.gnu.org/archive/html/qemu-devel/2026-02/msg01892.html
>>
>> As far as I can tell, Stefan asked for the QOM paths of attached
>> devices. @attached-dev provides it. Good. Why have @attached-cnt as
>> well?
>>
>
> Users can obtain the quantity more conveniently, avoiding the need to
> count the number of @attached-dev.
> If you think the @attached-cnt is redundant, I will remove it in next version.
Please do.
[...]
next prev parent reply other threads:[~2026-02-25 10:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-13 17:16 [PATCH V4 1/4] qapi/misc: Fix missed query-iothreads items Zhang Chen
2026-02-13 17:16 ` [PATCH V4 2/4] iothread: introduce iothread_ref/unref to track attached devices Zhang Chen
2026-02-18 20:53 ` Stefan Hajnoczi
2026-02-25 11:38 ` Zhang Chen
2026-02-13 17:16 ` [PATCH V4 3/4] iothread: track virtio-blk devices using IOThread reference counting Zhang Chen
2026-02-18 20:55 ` Stefan Hajnoczi
2026-02-24 2:55 ` Zhang Chen
2026-02-13 17:16 ` [PATCH V4 4/4] qapi: examine IOThread attachment status via query-iothreads Zhang Chen
2026-02-17 7:51 ` Markus Armbruster
2026-02-24 2:42 ` Zhang Chen
2026-02-24 8:42 ` Markus Armbruster
2026-02-25 10:29 ` Zhang Chen
2026-02-25 10:54 ` Markus Armbruster [this message]
2026-02-25 11:39 ` Zhang Chen
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=87jyw1um82.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=dave@treblig.org \
--cc=eblake@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=zhangckid@gmail.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 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.