* [Qemu-devel] [PATCH v5] hmp: add info iothreads command
@ 2015-06-26 8:07 Ting Wang
2015-07-03 12:43 ` Markus Armbruster
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Ting Wang @ 2015-06-26 8:07 UTC (permalink / raw)
To: qemu-devel, armbru; +Cc: famz, wu.wubin, stefanha, 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 <kathy.wangting@huawei.com>
---
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
diff --git a/hmp-commands.hx b/hmp-commands.hx
index d3b7932..c8c8d79 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -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
diff --git a/hmp.c b/hmp.c
index 070aaf8..7192494 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 0cf4f2a..c139a97 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 aeea2b5..917e827 100644
--- a/monitor.c
+++ b/monitor.c
@@ -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
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH v5] hmp: add info iothreads command
2015-06-26 8:07 [Qemu-devel] [PATCH v5] hmp: add info iothreads command Ting Wang
@ 2015-07-03 12:43 ` Markus Armbruster
2015-07-06 2:24 ` Ting Wang
2015-07-30 16:05 ` Luiz Capitulino
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Markus Armbruster @ 2015-07-03 12:43 UTC (permalink / raw)
To: Ting Wang; +Cc: stefanha, famz, qemu-devel, wu.wubin, Luiz Capitulino
Copying the HMP maintainer Luiz. You can feed your patch to
scripts/get_maintainer to find people to cc yourself.
Ting Wang <kathy.wangting@huawei.com> writes:
> 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>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH v5] hmp: add info iothreads command
2015-07-03 12:43 ` Markus Armbruster
@ 2015-07-06 2:24 ` Ting Wang
0 siblings, 0 replies; 9+ messages in thread
From: Ting Wang @ 2015-07-06 2:24 UTC (permalink / raw)
To: Markus Armbruster; +Cc: stefanha, famz, qemu-devel, wu.wubin, Luiz Capitulino
On 2015-7-3 20:43, Markus Armbruster wrote:
> Copying the HMP maintainer Luiz. You can feed your patch to
> scripts/get_maintainer to find people to cc yourself.
OK, thanks.
Ting
>
> Ting Wang <kathy.wangting@huawei.com> writes:
>
>> 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>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH v5] hmp: add info iothreads command
2015-06-26 8:07 [Qemu-devel] [PATCH v5] hmp: add info iothreads command Ting Wang
2015-07-03 12:43 ` Markus Armbruster
@ 2015-07-30 16:05 ` Luiz Capitulino
2015-07-31 1:09 ` Ting Wang
2015-07-30 16:51 ` Amos Jianjun Kong
2015-08-05 9:54 ` Markus Armbruster
3 siblings, 1 reply; 9+ messages in thread
From: Luiz Capitulino @ 2015-07-30 16:05 UTC (permalink / raw)
To: Ting Wang; +Cc: stefanha, famz, qemu-devel, wu.wubin, armbru
On Fri, 26 Jun 2015 16:07:13 +0800
Ting Wang <kathy.wangting@huawei.com> 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
>
> Signed-off-by: Ting Wang <kathy.wangting@huawei.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Markus will take this patch via his tree.
> ---
> 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
>
> diff --git a/hmp-commands.hx b/hmp-commands.hx
> index d3b7932..c8c8d79 100644
> --- a/hmp-commands.hx
> +++ b/hmp-commands.hx
> @@ -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
>
> diff --git a/hmp.c b/hmp.c
> index 070aaf8..7192494 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 0cf4f2a..c139a97 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 aeea2b5..917e827 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -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",
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH v5] hmp: add info iothreads command
2015-06-26 8:07 [Qemu-devel] [PATCH v5] hmp: add info iothreads command Ting Wang
2015-07-03 12:43 ` Markus Armbruster
2015-07-30 16:05 ` Luiz Capitulino
@ 2015-07-30 16:51 ` Amos Jianjun Kong
2015-07-30 17:07 ` Paolo Bonzini
2015-08-05 9:54 ` Markus Armbruster
3 siblings, 1 reply; 9+ messages in thread
From: Amos Jianjun Kong @ 2015-07-30 16:51 UTC (permalink / raw)
To: Ting Wang; +Cc: Stefan Hajnoczi, famz, qemu-devel, wu.wubin, Markus Armbruster
On Fri, Jun 26, 2015 at 4:07 PM, Ting Wang <kathy.wangting@huawei.com> 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
>
> Signed-off-by: Ting Wang <kathy.wangting@huawei.com>
> ---
> 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
>
> diff --git a/hmp-commands.hx b/hmp-commands.hx
> index d3b7932..c8c8d79 100644
> --- a/hmp-commands.hx
> +++ b/hmp-commands.hx
> @@ -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
>
> diff --git a/hmp.c b/hmp.c
> index 070aaf8..7192494 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",
How about add a '\' at the beginning of each line? similar as the
output of 'info network'
> + 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 0cf4f2a..c139a97 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 aeea2b5..917e827 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -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
>
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH v5] hmp: add info iothreads command
2015-07-30 16:51 ` Amos Jianjun Kong
@ 2015-07-30 17:07 ` Paolo Bonzini
2015-07-30 17:09 ` Amos Jianjun Kong
0 siblings, 1 reply; 9+ messages in thread
From: Paolo Bonzini @ 2015-07-30 17:07 UTC (permalink / raw)
To: Amos Jianjun Kong, Ting Wang
Cc: wu.wubin, famz, qemu-devel, Stefan Hajnoczi, Markus Armbruster
On 30/07/2015 18:51, Amos Jianjun Kong wrote:
>> > +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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH v5] hmp: add info iothreads command
2015-07-30 17:07 ` Paolo Bonzini
@ 2015-07-30 17:09 ` Amos Jianjun Kong
0 siblings, 0 replies; 9+ messages in thread
From: Amos Jianjun Kong @ 2015-07-30 17:09 UTC (permalink / raw)
To: Paolo Bonzini
Cc: famz, Ting Wang, Markus Armbruster, qemu-devel, Stefan Hajnoczi,
wu.wubin
On Fri, Jul 31, 2015 at 1:07 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> On 30/07/2015 18:51, Amos Jianjun Kong wrote:
>>> > +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.
Got it.
Reviewed-by: Amos Jianjun Kong <kongjianjun@gmail.com>
> Paolo
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH v5] hmp: add info iothreads command
2015-07-30 16:05 ` Luiz Capitulino
@ 2015-07-31 1:09 ` Ting Wang
0 siblings, 0 replies; 9+ messages in thread
From: Ting Wang @ 2015-07-31 1:09 UTC (permalink / raw)
To: Luiz Capitulino; +Cc: stefanha, famz, qemu-devel, wu.wubin, armbru
On 2015-7-31 0:05, Luiz Capitulino wrote:
> On Fri, 26 Jun 2015 16:07:13 +0800
> Ting Wang <kathy.wangting@huawei.com> 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
>>
>> Signed-off-by: Ting Wang <kathy.wangting@huawei.com>
> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
>
> Markus will take this patch via his tree.
Thanks.
Ting
>> ---
>> 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
>>
>> diff --git a/hmp-commands.hx b/hmp-commands.hx
>> index d3b7932..c8c8d79 100644
>> --- a/hmp-commands.hx
>> +++ b/hmp-commands.hx
>> @@ -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
>>
>> diff --git a/hmp.c b/hmp.c
>> index 070aaf8..7192494 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 0cf4f2a..c139a97 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 aeea2b5..917e827 100644
>> --- a/monitor.c
>> +++ b/monitor.c
>> @@ -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",
>
> .
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH v5] hmp: add info iothreads command
2015-06-26 8:07 [Qemu-devel] [PATCH v5] hmp: add info iothreads command Ting Wang
` (2 preceding siblings ...)
2015-07-30 16:51 ` Amos Jianjun Kong
@ 2015-08-05 9:54 ` Markus Armbruster
3 siblings, 0 replies; 9+ messages in thread
From: Markus Armbruster @ 2015-08-05 9:54 UTC (permalink / raw)
To: Ting Wang; +Cc: stefanha, famz, qemu-devel, wu.wubin
Ting Wang <kathy.wangting@huawei.com> writes:
> 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>
Applied to my qapi-next[*] branch, thanks!
[*] Close enough --- can't be bothered to create a separate monitor-next
branch right now :)
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-08-05 9:59 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-26 8:07 [Qemu-devel] [PATCH v5] hmp: add info iothreads command Ting Wang
2015-07-03 12:43 ` Markus Armbruster
2015-07-06 2:24 ` Ting Wang
2015-07-30 16:05 ` Luiz Capitulino
2015-07-31 1:09 ` Ting Wang
2015-07-30 16:51 ` Amos Jianjun Kong
2015-07-30 17:07 ` Paolo Bonzini
2015-07-30 17:09 ` Amos Jianjun Kong
2015-08-05 9:54 ` Markus Armbruster
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.