Skip to content

Commit 5fc0048

Browse files
phrdinadagrh
authored andcommitted
monitor: add poll-* properties into query-iothreads result
IOthreads were recently extended by new properties that can enable/disable and configure aio polling. This will also allow other tools that uses QEMU to probe for existence of those new properties via query-qmp-schema. Signed-off-by: Pavel Hrdina <[email protected]> Message-Id: <3163c16d6ab4257f7be9ad44fe9cc0ce8c359e5a.1486718555.git.phrdina@redhat.com> Reviewed-by: Stefan Hajnoczi <[email protected]> Signed-off-by: Dr. David Alan Gilbert <[email protected]>
1 parent 3f35c3b commit 5fc0048

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

hmp.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -2149,10 +2149,15 @@ void hmp_info_iothreads(Monitor *mon, const QDict *qdict)
21492149
{
21502150
IOThreadInfoList *info_list = qmp_query_iothreads(NULL);
21512151
IOThreadInfoList *info;
2152+
IOThreadInfo *value;
21522153

21532154
for (info = info_list; info; info = info->next) {
2154-
monitor_printf(mon, "%s: thread_id=%" PRId64 "\n",
2155-
info->value->id, info->value->thread_id);
2155+
value = info->value;
2156+
monitor_printf(mon, "%s:\n", value->id);
2157+
monitor_printf(mon, " thread_id=%" PRId64 "\n", value->thread_id);
2158+
monitor_printf(mon, " poll-max-ns=%" PRId64 "\n", value->poll_max_ns);
2159+
monitor_printf(mon, " poll-grow=%" PRId64 "\n", value->poll_grow);
2160+
monitor_printf(mon, " poll-shrink=%" PRId64 "\n", value->poll_shrink);
21562161
}
21572162

21582163
qapi_free_IOThreadInfoList(info_list);

iothread.c

+3
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,9 @@ static int query_one_iothread(Object *object, void *opaque)
268268
info = g_new0(IOThreadInfo, 1);
269269
info->id = iothread_get_id(iothread);
270270
info->thread_id = iothread->thread_id;
271+
info->poll_max_ns = iothread->poll_max_ns;
272+
info->poll_grow = iothread->poll_grow;
273+
info->poll_shrink = iothread->poll_shrink;
271274

272275
elem = g_new0(IOThreadInfoList, 1);
273276
elem->value = info;

qapi-schema.json

+14-1
Original file line numberDiff line numberDiff line change
@@ -1427,10 +1427,23 @@
14271427
#
14281428
# @thread-id: ID of the underlying host thread
14291429
#
1430+
# @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
1431+
# (since 2.9)
1432+
#
1433+
# @poll-grow: how many ns will be added to polling time, 0 means that it's not
1434+
# configured (since 2.9)
1435+
#
1436+
# @poll-shrink: how many ns will be removed from polling time, 0 means that
1437+
# it's not configured (since 2.9)
1438+
#
14301439
# Since: 2.0
14311440
##
14321441
{ 'struct': 'IOThreadInfo',
1433-
'data': {'id': 'str', 'thread-id': 'int'} }
1442+
'data': {'id': 'str',
1443+
'thread-id': 'int',
1444+
'poll-max-ns': 'int',
1445+
'poll-grow': 'int',
1446+
'poll-shrink': 'int' } }
14341447

14351448
##
14361449
# @query-iothreads:

0 commit comments

Comments
 (0)