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>
Subject: Re: [PATCH 3/3] qapi: Add thread_status flag for iothreads
Date: Fri, 23 Jan 2026 14:06:24 +0100 [thread overview]
Message-ID: <87jyx8a373.fsf@pond.sub.org> (raw)
In-Reply-To: <CAK3tnvK=hyrVhwyEHfAOaDNStG=C9irPK39ua=g=Upep6f8g6g@mail.gmail.com> (Zhang Chen's message of "Fri, 16 Jan 2026 16:41:21 +0800")
Zhang Chen <zhangckid@gmail.com> writes:
> On Fri, Jan 16, 2026 at 4:18 PM Markus Armbruster <armbru@redhat.com> wrote:
>>
>> Zhang Chen <zhangckid@gmail.com> writes:
>>
>> > On Thu, Jan 8, 2026 at 8:12 PM Markus Armbruster <armbru@redhat.com> wrote:
>> >>
>> >> Zhang Chen <zhangckid@gmail.com> writes:
>> >>
>> >> > The thread_status depends on struct IOThreadInfo's
>> >> > 'attached': 'bool'. Show in the qmp/hmp CMD with
>> >> > 'attached' or 'detached'.
>> >> >
>> >> > Signed-off-by: Zhang Chen <zhangckid@gmail.com>
>> >> > ---
>> >> > iothread.c | 1 +
>> >> > monitor/hmp-cmds.c | 2 ++
>> >> > qapi/misc.json | 6 ++++++
>> >> > 3 files changed, 9 insertions(+)
>> >> >
>> >> > diff --git a/iothread.c b/iothread.c
>> >> > index 38e38fb44d..fb4898e491 100644
>> >> > --- a/iothread.c
>> >> > +++ b/iothread.c
>> >> > @@ -358,6 +358,7 @@ static int query_one_iothread(Object *object, void *opaque)
>> >> > info = g_new0(IOThreadInfo, 1);
>> >> > info->id = iothread_get_id(iothread);
>> >> > info->thread_id = iothread->thread_id;
>> >> > + info->attached = iothread->attached;
>> >> > info->poll_max_ns = iothread->poll_max_ns;
>> >> > info->poll_grow = iothread->poll_grow;
>> >> > info->poll_shrink = iothread->poll_shrink;
>> >> > diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
>> >> > index 33a88ce205..84b01737cf 100644
>> >> > --- a/monitor/hmp-cmds.c
>> >> > +++ b/monitor/hmp-cmds.c
>> >> > @@ -197,6 +197,8 @@ void hmp_info_iothreads(Monitor *mon, const QDict *qdict)
>> >> > value = info->value;
>> >> > monitor_printf(mon, "%s:\n", value->id);
>> >> > monitor_printf(mon, " thread_id=%" PRId64 "\n", value->thread_id);
>> >> > + monitor_printf(mon, " thread_status=%s" "\n",
>> >> > + value->attached ? "attached" : "detached");
>> >> > monitor_printf(mon, " poll-max-ns=%" PRId64 "\n", value->poll_max_ns);
>> >> > monitor_printf(mon, " poll-grow=%" PRId64 "\n", value->poll_grow);
>> >> > monitor_printf(mon, " poll-shrink=%" PRId64 "\n", value->poll_shrink);
>> >> > diff --git a/qapi/misc.json b/qapi/misc.json
>> >> > index 6153ed3d04..2eea920bd2 100644
>> >> > --- a/qapi/misc.json
>> >> > +++ b/qapi/misc.json
>> >> > @@ -76,6 +76,9 @@
>> >> > #
>> >> > # @thread-id: ID of the underlying host thread
>> >> > #
>> >> > +# @attached: flag to show current iothread attached status
>> >>
>> >> What does "attached status" actually mean?
>> >
>> > This flag means weather the "-object iothread" already been used by a
>> > real device.
>> > In hotplug scenario, user can add multiple "-object iothread" and
>> > multiple devices (like virtio-blk).
>> > When user hotunplug the devices can keep the iothreads as a thread
>> > pool, following the new
>> > hotplug devices can attach to the released iothread.
>>
>> Why would a management application or human user want to know this?
>
> Because some usercases already been changed.
> This demand comes from Cloud Native ecosystem.
> User want to manage resources more flexible like containers (Kata container).
> The real workload maybe changed(runc) in the VM without VM reboot,
> It may need hotplug/unplug different multi disks with multi iothreads to meet
> high level scheduler's needs(like K8s).
In your v2, you added a (broken) PATCH 4 that describes @attached as
follows:
The ``attached`` parameter is a flag to show whether the iothread
is attached to an actual device(for example virtio-blk). In hotplug
scenario, user can add multiple "-object iothread" and multiple
devices (like virtio-blk). When user hotunplug the devices can keep
the iothreads as a thread pool, following the new hotplug devices can
attach to the released iothread.
Should this information go into the QAPI schema, too?
>> The answer should lead us to better doc text.
>>
>
> OK, I will add it in next version.
[...]
next prev parent reply other threads:[~2026-01-23 13:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-29 10:38 [PATCH 1/3] qapi/misc: Fix missed query-iothreads items Zhang Chen
2025-12-29 10:38 ` [PATCH 2/3] iothread: Introduce a new flag to show iothreads attached status Zhang Chen
2025-12-29 10:38 ` [PATCH 3/3] qapi: Add thread_status flag for iothreads Zhang Chen
2026-01-08 12:12 ` Markus Armbruster
2026-01-09 3:11 ` Zhang Chen
2026-01-15 17:44 ` Zhang Chen
2026-01-16 8:18 ` Markus Armbruster
2026-01-16 8:41 ` Zhang Chen
2026-01-23 13:06 ` Markus Armbruster [this message]
2026-01-08 12:06 ` [PATCH 1/3] qapi/misc: Fix missed query-iothreads items Markus Armbruster
2026-01-09 2:56 ` 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=87jyx8a373.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=dave@treblig.org \
--cc=eblake@redhat.com \
--cc=qemu-devel@nongnu.org \
--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.