Received: from eggs.gnu.org ([2001:4830:134:3::10]:50279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXrud-0008Ld-0B for qemu-devel@nongnu.org; Fri, 04 Sep 2015 10:24:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXrua-0002lJ-2O for qemu-devel@nongnu.org; Fri, 04 Sep 2015 10:24:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50504) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXruZ-0002ka-U8 for qemu-devel@nongnu.org; Fri, 04 Sep 2015 10:24:16 -0400 From: Markus Armbruster Date: Fri, 4 Sep 2015 16:24:13 +0200 Message-Id: <1441376653-15029-3-git-send-email-armbru@redhat.com> In-Reply-To: <1441376653-15029-1-git-send-email-armbru@redhat.com> References: <1441376653-15029-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PULL 2/2] hmp: add info iothreads command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Ting Wang From: Ting Wang Make "info iothreads" available on the HMP monitor. For example, the results are as follows when executing qemu command with "-object iothread,id=iothread-1 -object iothread,id=iothread-2". (qemu) info iothreads iothread-1: thread_id=123 iothread-2: thread_id=456 Signed-off-by: Ting Wang Message-Id: <1435306033-58372-1-git-send-email-kathy.wangting@huawei.com> Reviewed-by: Luiz Capitulino Reviewed-by: Amos Jianjun Kong Signed-off-by: Markus Armbruster --- hmp-commands.hx | 2 ++ hmp.c | 13 +++++++++++++ hmp.h | 1 + monitor.c | 7 +++++++ 4 files changed, 23 insertions(+) diff --git a/hmp-commands.hx b/hmp-commands.hx index d6e81e4..286dcc7 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1809,6 +1809,8 @@ show the TPM device show the memory devices @item info skeys Display the value of a storage key (s390 only) +@item info iothreads +show iothreads @end table ETEXI diff --git a/hmp.c b/hmp.c index dcc66f1..3f807b7 100644 --- a/hmp.c +++ b/hmp.c @@ -1963,6 +1963,19 @@ void hmp_info_memory_devices(Monitor *mon, const QDict *qdict) qapi_free_MemoryDeviceInfoList(info_list); } +void hmp_info_iothreads(Monitor *mon, const QDict *qdict) +{ + IOThreadInfoList *info_list = qmp_query_iothreads(NULL); + IOThreadInfoList *info; + + for (info = info_list; info; info = info->next) { + monitor_printf(mon, "%s: thread_id=%" PRId64 "\n", + info->value->id, info->value->thread_id); + } + + qapi_free_IOThreadInfoList(info_list); +} + void hmp_qom_list(Monitor *mon, const QDict *qdict) { const char *path = qdict_get_try_str(qdict, "path"); diff --git a/hmp.h b/hmp.h index b8f5d33..81656c3 100644 --- a/hmp.h +++ b/hmp.h @@ -39,6 +39,7 @@ void hmp_info_balloon(Monitor *mon, const QDict *qdict); void hmp_info_pci(Monitor *mon, const QDict *qdict); void hmp_info_block_jobs(Monitor *mon, const QDict *qdict); void hmp_info_tpm(Monitor *mon, const QDict *qdict); +void hmp_info_iothreads(Monitor *mon, const QDict *qdict); void hmp_quit(Monitor *mon, const QDict *qdict); void hmp_stop(Monitor *mon, const QDict *qdict); void hmp_system_reset(Monitor *mon, const QDict *qdict); diff --git a/monitor.c b/monitor.c index b1f2a29..5455ab9 100644 --- a/monitor.c +++ b/monitor.c @@ -2854,6 +2854,13 @@ static mon_cmd_t info_cmds[] = { .mhandler.cmd = hmp_info_memory_devices, }, { + .name = "iothreads", + .args_type = "", + .params = "", + .help = "show iothreads", + .mhandler.cmd = hmp_info_iothreads, + }, + { .name = "rocker", .args_type = "name:s", .params = "name", -- 2.4.3