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 <phrdina@redhat.com>
---
The other possible way would be to introduce object-list-properties
which I think would be good in general for the same reason why
device-list-properties exists.
hmp.c | 9 +++++++--
iothread.c | 3 +++
qapi-schema.json | 15 ++++++++++++++-
3 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/hmp.c b/hmp.c
index 2bc4f062bb..d713151cbc 100644
--- a/hmp.c
+++ b/hmp.c
@@ -2148,10 +2148,15 @@ void hmp_info_iothreads(Monitor *mon, const QDict *qdict)
{
IOThreadInfoList *info_list = qmp_query_iothreads(NULL);
IOThreadInfoList *info;
+ IOThreadInfo *value;
for (info = info_list; info; info = info->next) {
- monitor_printf(mon, "%s: thread_id=%" PRId64 "\n",
- info->value->id, info->value->thread_id);
+ value = info->value;
+ monitor_printf(mon, "%s:\n", value->id);
+ monitor_printf(mon, " thread_id=%" PRId64 "\n", value->thread_id);
+ 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);
}
qapi_free_IOThreadInfoList(info_list);
diff --git a/iothread.c b/iothread.c
index 257b01d5f1..beeb870534 100644
--- a/iothread.c
+++ b/iothread.c
@@ -268,6 +268,9 @@ 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->poll_max_ns = iothread->poll_max_ns;
+ info->poll_grow = iothread->poll_grow;
+ info->poll_shrink = iothread->poll_shrink;
elem = g_new0(IOThreadInfoList, 1);
elem->value = info;
diff --git a/qapi-schema.json b/qapi-schema.json
index cbdffddbc6..a97a054c81 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -1422,10 +1422,23 @@
#
# @thread-id: ID of the underlying host thread
#
+# @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
+# (since 2.9)
+#
+# @poll-grow: how many ns will be added to polling time, 0 means that it's not
+# configured (since 2.9)
+#
+# @poll-shrink: how many ns will be removed from polling time, 0 means that
+# it's not configured (since 2.9)
+#
# Since: 2.0
##
{ 'struct': 'IOThreadInfo',
- 'data': {'id': 'str', 'thread-id': 'int'} }
+ 'data': {'id': 'str',
+ 'thread-id': 'int',
+ 'poll-max-ns': 'int',
+ 'poll-grow': 'int',
+ 'poll-shrink': 'int' } }
##
# @query-iothreads:
--
2.11.1
Hi, Your series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally. Subject: [Qemu-devel] [PATCH] monitor: add poll-* properties into query-iothreads result Message-id: 3163c16d6ab4257f7be9ad44fe9cc0ce8c359e5a.1486718555.git.phrdina@redhat.com Type: series === TEST SCRIPT BEGIN === #!/bin/bash set -e git submodule update --init dtc # Let docker tests dump environment info export SHOW_ENV=1 export J=16 make docker-test-quick@centos6 make docker-test-mingw@fedora make docker-test-build@min-glib === TEST SCRIPT END === Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384 Switched to a new branch 'test' ae03e60 monitor: add poll-* properties into query-iothreads result === OUTPUT BEGIN === Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc' fatal: read error: Connection reset by peer Cloning into 'dtc'... Clone of 'git://git.qemu-project.org/dtc.git' into submodule path 'dtc' failed === OUTPUT END === Test command exited with code: 1 --- Email generated automatically by Patchew [http://patchew.org/]. Please send your feedback to patchew-devel@freelists.org
On Fri, Feb 10, 2017 at 10:41:17AM +0100, Pavel Hrdina wrote: > 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 <phrdina@redhat.com> > --- > > The other possible way would be to introduce object-list-properties > which I think would be good in general for the same reason why > device-list-properties exists. > > hmp.c | 9 +++++++-- > iothread.c | 3 +++ > qapi-schema.json | 15 ++++++++++++++- > 3 files changed, 24 insertions(+), 3 deletions(-) Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
* Pavel Hrdina (phrdina@redhat.com) wrote:
> 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 <phrdina@redhat.com>
Queued for HMP
> ---
>
> The other possible way would be to introduce object-list-properties
> which I think would be good in general for the same reason why
> device-list-properties exists.
>
> hmp.c | 9 +++++++--
> iothread.c | 3 +++
> qapi-schema.json | 15 ++++++++++++++-
> 3 files changed, 24 insertions(+), 3 deletions(-)
>
> diff --git a/hmp.c b/hmp.c
> index 2bc4f062bb..d713151cbc 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -2148,10 +2148,15 @@ void hmp_info_iothreads(Monitor *mon, const QDict *qdict)
> {
> IOThreadInfoList *info_list = qmp_query_iothreads(NULL);
> IOThreadInfoList *info;
> + IOThreadInfo *value;
>
> for (info = info_list; info; info = info->next) {
> - monitor_printf(mon, "%s: thread_id=%" PRId64 "\n",
> - info->value->id, info->value->thread_id);
> + value = info->value;
> + monitor_printf(mon, "%s:\n", value->id);
> + monitor_printf(mon, " thread_id=%" PRId64 "\n", value->thread_id);
> + 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);
> }
>
> qapi_free_IOThreadInfoList(info_list);
> diff --git a/iothread.c b/iothread.c
> index 257b01d5f1..beeb870534 100644
> --- a/iothread.c
> +++ b/iothread.c
> @@ -268,6 +268,9 @@ 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->poll_max_ns = iothread->poll_max_ns;
> + info->poll_grow = iothread->poll_grow;
> + info->poll_shrink = iothread->poll_shrink;
>
> elem = g_new0(IOThreadInfoList, 1);
> elem->value = info;
> diff --git a/qapi-schema.json b/qapi-schema.json
> index cbdffddbc6..a97a054c81 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -1422,10 +1422,23 @@
> #
> # @thread-id: ID of the underlying host thread
> #
> +# @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
> +# (since 2.9)
> +#
> +# @poll-grow: how many ns will be added to polling time, 0 means that it's not
> +# configured (since 2.9)
> +#
> +# @poll-shrink: how many ns will be removed from polling time, 0 means that
> +# it's not configured (since 2.9)
> +#
> # Since: 2.0
> ##
> { 'struct': 'IOThreadInfo',
> - 'data': {'id': 'str', 'thread-id': 'int'} }
> + 'data': {'id': 'str',
> + 'thread-id': 'int',
> + 'poll-max-ns': 'int',
> + 'poll-grow': 'int',
> + 'poll-shrink': 'int' } }
>
> ##
> # @query-iothreads:
> --
> 2.11.1
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
© 2016 - 2026 Red Hat, Inc.