[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] hmp.c: Revert hmp_info_cpus output format
From: |
satheesh rajendran |
Subject: |
Re: [Qemu-devel] [PATCH] hmp.c: Revert hmp_info_cpus output format |
Date: |
Tue, 27 Mar 2018 18:54:21 +0530 |
User-agent: |
Mutt/1.9.2 (2017-12-15) |
On Tue, Mar 27, 2018 at 01:40:00PM +0100, Daniel P. Berrangé wrote:
> On Tue, Mar 27, 2018 at 06:08:00PM +0530, address@hidden wrote:
> > From: Satheesh Rajendran <address@hidden>
> >
> > This commit 137b5cb6ab565cb3781d5337591e155932b4230e
> > refactors info cpus output and changes output format from
> > 'thread_id' to 'thread-id', this would break parsing
> > of output in above layers like libvirt, test framework etc.
>
> Libvirt doesn't use HMP, only QMP, so this shouldn't have broken libvirt
> afaik. HMP is not intended to be a stable API so these kind of changes
> should be expected.
Am sure avocado test framework uses this output for parsing to extract threadid
and in libvirt atleast I checked below code uses it, I hope keeping the
format same as previous won't affect anything?
in src/qemu/qemu_monitor_text.c
int
qemuMonitorTextQueryCPUs(qemuMonitorPtr mon,
struct qemuMonitorQueryCpusEntry **entries,
size_t *nentries)
...
if (qemuMonitorHMPCommand(mon, "info cpus", &qemucpus) < 0)
return -1;
/*
* This is the gross format we're about to parse :-{
*
* (qemu) info cpus
* * CPU #0: pc=0x00000000000f0c4a thread_id=30019
* CPU #1: pc=0x00000000fffffff0 thread_id=30020
* CPU #2: pc=0x00000000fffffff0 (halted) thread_id=30021
*
*/
....
/* Extract host Thread ID */
if ((offset = strstr(line, "thread_id=")) == NULL)
Regards,
-Satheesh
>
> >
> > This patch just reverts back output format to 'thread_id'.
> >
> > CC: Viktor Mihajlovski <address@hidden>
> > Signed-off-by: Satheesh Rajendran <address@hidden>
> > ---
> > hmp.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/hmp.c b/hmp.c
> > index 679467d85a..a25c7bd9a8 100644
> > --- a/hmp.c
> > +++ b/hmp.c
> > @@ -381,7 +381,7 @@ void hmp_info_cpus(Monitor *mon, const QDict *qdict)
> >
> > monitor_printf(mon, "%c CPU #%" PRId64 ":", active,
> > cpu->value->cpu_index);
> > - monitor_printf(mon, " thread-id=%" PRId64 "\n",
> > cpu->value->thread_id);
> > + monitor_printf(mon, " thread_id=%" PRId64 "\n",
> > cpu->value->thread_id);
> > }
> >
> > qapi_free_CpuInfoFastList(cpu_list);
> > --
> > 2.14.3
> >
> >
>
> Regards,
> Daniel
> --
> |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org -o- https://fstop138.berrange.com :|
> |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
>