hmp: add info iothreads command
PATCH v5 1/1 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
---
v5: use "for" instead of "while"
--- hmp-commands.hx | 2 ++ hmp.c | 13 +++++++++++++ hmp.h | 1 + monitor.c | 7 +++++++ 4 files changed, 23 insertions(+)execute
hmp-commands.hx +2 -0
@@ -1790,6 +1790,8 @@ show roms show the TPM device @item info memory-devices show the memory devices +@item info iothreads +show iothreads @end table ETEXI
hmp.c +13 -0
@@ -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" );
hmp.h +1 -0
@@ -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);
monitor.c +7 -0
@@ -2850,6 +2850,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",
Signature · 1 line
1.7.12.4
Copying the HMP maintainer Luiz. You can feed your patch to scripts/get_maintainer to find people to cc yourself.
Quoted 10 lines · 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=456Signed-off-by Ting Wang <[email protected]>
Quoted 2 lines · Markus Armbruster
Copying the HMP maintainer Luiz. You can feed your patch to
scripts/get_maintainerto find people to cc yourself.
OK, thanks.
Ting
Quoted 16 lines
Quoted 10 lines · 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=456Signed-off-by Ting Wang <[email protected]>Reviewed-by Markus Armbruster <[email protected]>
Quoted 10 lines · On Fri, 26 Jun 2015 16:07:13 +0800 Ting Wang <[email protected]> wrote:
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=456Signed-off-by Ting Wang <[email protected]>
Markus will take this patch via his tree.
Quoted 76 lines
---
v5: use "for" instead of "while"--- hmp-commands.hx | 2 ++ hmp.c | 13 +++++++++++++ hmp.h | 1 + monitor.c | 7 +++++++ 4 files changed, 23 insertions(+)executehmp-commands.hx +2
-0@@ -1790,6 +1790,8 @@ show roms show the TPM device @item info memory-devices show the memory devices +@item info iothreads +show iothreads @end table ETEXIhmp.c +13
-0@@ -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" );hmp.h +1
-0@@ -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);monitor.c +7
-0@@ -2850,6 +2850,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",
Quoted 12 lines · Luiz Capitulino
Quoted 9 lines · On Fri, 26 Jun 2015 16:07:13 +0800 Ting Wang <[email protected]> wrote:
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
Quoted 4 lines
Quoted 1 line
Signed-off-by Ting Wang <[email protected]>Reviewed-by Luiz Capitulino <[email protected]>Markus will take this patch via his tree.
Thanks.
Ting
Quoted 79 lines
Quoted 66 lines
---
v5: use "for" instead of "while"--- hmp-commands.hx | 2 ++ hmp.c | 13 +++++++++++++ hmp.h | 1 + monitor.c | 7 +++++++ 4 files changed, 23 insertions(+)executehmp-commands.hx +2
-0@@ -1790,6 +1790,8 @@ show roms show the TPM device @item info memory-devices show the memory devices +@item info iothreads +show iothreads @end table ETEXIhmp.c +13
-0@@ -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" );hmp.h +1
-0@@ -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);monitor.c +0
-0@@ -2850,6 +2850,13 @@ static mon_cmd_t info_cmds[] = { .mhandler.cmd = hmp_info_memory_devices, }, {monitor.c static mon_cmd_t info_cmds[] = { · line 2862
Quoted 10 lines
monitor.c +7
-0+ .name = "iothreads", + .args_type = "", + .params = "", + .help = "show iothreads", + .mhandler.cmd = hmp_info_iothreads, + }, + { .name = "rocker", .args_type = "name:s", .params = "name",.
Quoted 37 lines · 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=456Signed-off-by Ting Wang <[email protected]>---
v5: use "for" instead of "while"--- hmp-commands.hx | 2 ++ hmp.c | 13 +++++++++++++ hmp.h | 1 + monitor.c | 7 +++++++ 4 files changed, 23 insertions(+)executehmp-commands.hx +2
-0@@ -1790,6 +1790,8 @@ show roms show the TPM device @item info memory-devices show the memory devices +@item info iothreads +show iothreads @end table ETEXIhmp.c +0
-0
hmp.c void hmp_info_memory_devices(Monitor *mon, const QDict *qdict) · line 1972
Quoted 10 lines
hmp.c +7
-0@@ -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",
How about add a '\' at the beginning of each line? similar as the output of 'info network'
Quoted 44 lines
hmp.c +6
-0+ 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" );hmp.h +1
-0@@ -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);monitor.c +7
-1@@ -2850,6 +2850,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", --1.7.12.4
Quoted 10 lines · Amos Jianjun Kong
Quoted 7 lines
hmp.c void hmp_info_memory_devices(Monitor *mon, const QDict *qdict) · line 1972
Quoted 7 lines
hmp.c +7
-0+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",How about add a '\' at the beginning of each line? similar as the output of 'info network'
For 'info network', the \ represents the peer relationship between e.g. NIC and backend. There is no such relationship for iothreads.
Paolo
Amos Jianjun Kong
Reviewed-byQuoted 14 lines · Paolo Bonzini
Quoted 10 lines · Amos Jianjun Kong
Quoted 7 lines
hmp.c void hmp_info_memory_devices(Monitor *mon, const QDict *qdict) · line 1972
Quoted 7 lines
hmp.c +7
-0+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",How about add a '\' at the beginning of each line? similar as the output of 'info network'
Quoted 2 lines
For 'info network', the \ represents the peer relationship between e.g. NIC and backend. There is no such relationship for iothreads.
Got it.
Quoted 1 line
Paolo
Markus Armbruster
AppliedQuoted 10 lines · 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=456Signed-off-by Ting Wang <[email protected]>
Applied to my qapi-next[*] branch, thanks!
[*] Close enough --- can't be bothered to create a separate monitor-next branch right now :)