From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7NAe-0000cB-CB for qemu-devel@nongnu.org; Tue, 23 Jun 2015 08:19:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7NAZ-0004Om-88 for qemu-devel@nongnu.org; Tue, 23 Jun 2015 08:19:20 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:48731) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7NAY-0004OX-VC for qemu-devel@nongnu.org; Tue, 23 Jun 2015 08:19:15 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 23 Jun 2015 13:19:11 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id BD4FE2190067 for ; Tue, 23 Jun 2015 13:18:47 +0100 (BST) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t5NCJ9Zl26345478 for ; Tue, 23 Jun 2015 12:19:09 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t5NCJ9C7029807 for ; Tue, 23 Jun 2015 06:19:09 -0600 Message-ID: <55894EBB.6090302@de.ibm.com> Date: Tue, 23 Jun 2015 14:19:07 +0200 From: Christian Borntraeger MIME-Version: 1.0 References: <1426237119-110112-1-git-send-email-kathy.wangting@huawei.com> <5588C2E5.2070805@huawei.com> <87h9py3aej.fsf@blackfin.pond.sub.org> In-Reply-To: <87h9py3aej.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4] hmp: add info iothreads command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , Ting Wang Cc: famz@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, lcapitulino@redhat.com Am 23.06.2015 um 13:57 schrieb Markus Armbruster: > Ting Wang writes: > >> Hi Luiz and Markus, >> >> Would you like to pick up this patch, which has >> been reviewed by Stefan and Fam? > > Looks like this fell through the cracks back in March. You should've > asked for merge much earlier. Pinging the maintainer after two weeks is > fair. > > I just did a monitor pull, and I can't yet say whether I'll do another > for 2.4. > > Quick review inline. > Is there some patch available that allows someone to query the disks attached to an iothread (or check if a disk uses iothreads?). I had several testers asking why x-dataplane is off after specifying iothread. Maybe this information could be added here as well? >> >> Thanks. >> >> Ting >> >> On 2015-3-13 16:58, Ting Wang wrote: >>> Make "info iothreads" available on the HMP monitor. >>> >>> The results are as follows: >>> id1: thread_id=thread_id1 >>> id2: thread_id=thread_id2 > > Actually, they are like > > id1: thread_id=123 > id2: thread_id=456 > > Recommend to paste actual output from your testing. > >>> >>> Signed-off-by: Ting Wang >>> --- >>> v4: use the PRId64 format specifier macro for the int64_t thread_id >>> v3: fix comment and the trailing whitespace >>> v2: add braces for if >>> --- >>> hmp-commands.hx | 2 ++ >>> hmp.c | 22 ++++++++++++++++++++++ >>> hmp.h | 1 + >>> monitor.c | 7 +++++++ >>> 4 files changed, 32 insertions(+) >>> >>> diff --git a/hmp-commands.hx b/hmp-commands.hx >>> index d5022d8..67d76ed 100644 >>> --- a/hmp-commands.hx >>> +++ b/hmp-commands.hx >>> @@ -1746,6 +1746,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 71c28bc..445a8ad 100644 >>> --- a/hmp.c >>> +++ b/hmp.c >>> @@ -821,6 +821,28 @@ void hmp_info_tpm(Monitor *mon, const QDict *qdict) >>> qapi_free_TPMInfoList(info_list); >>> } >>> >>> +void hmp_info_iothreads(Monitor *mon, const QDict *qdict) >>> +{ >>> + IOThreadInfoList *head = NULL, *elem = NULL; >>> + >>> + head = qmp_query_iothreads(NULL); >>> + if (!head) { >>> + monitor_printf(mon, "No iothread has been added\n"); >>> + return; >>> + } > > Printing something instead of nothing when the list is empty is matter > of taste. Consistency would be nice, though. I know several commands > that print nothing. Can you quote commands printing something? > >>> + >>> + elem = head; >>> + while (elem) { >>> + if (elem->value) { >>> + monitor_printf(mon, "%s: thread_id=%" PRId64 "\n", elem->value->id, >>> + elem->value->thread_id); >>> + } >>> + elem = elem->next; >>> + } > > for (info = info_list; info; info = info->next) { > monitor_printf(mon, "%s: thread_id=%" PRId64 "\n", > elem->value->id, elem->value->thread_id); > } > > 1. for is more readable than while, because it has the full loop control > in one place. > > 2. List elements cannot be null, so don't bother checking for it. > >>> + >>> + qapi_free_IOThreadInfoList(head); >>> +} >>> + >>> void hmp_quit(Monitor *mon, const QDict *qdict) >>> { >>> monitor_suspend(mon); >>> diff --git a/hmp.h b/hmp.h >>> index 81177b2..d99090e 100644 >>> --- a/hmp.h >>> +++ b/hmp.h >>> @@ -38,6 +38,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 c86a89e..076a306 100644 >>> --- a/monitor.c >>> +++ b/monitor.c >>> @@ -2924,6 +2924,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 = NULL, >>> }, >>> }; >>> >