hmp: add info iothreads command

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 <kathy.wangting@huawei.com>
Message-Id: <1435306033-58372-1-git-send-email-kathy.wangting@huawei.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Amos Jianjun Kong <kongjianjun@gmail.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
Ting Wang 2015-06-26 16:07:13 +08:00 committed by Markus Armbruster
parent e2f9a6572b
commit 62313160cb
4 changed files with 23 additions and 0 deletions

View File

@ -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

13
hmp.c
View File

@ -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");

1
hmp.h
View File

@ -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);

View File

@ -2853,6 +2853,13 @@ static mon_cmd_t info_cmds[] = {
.help = "show memory devices",
.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",