On Thu, Jan 29, 2015 at 15:12:49 +0100, Igor Mammedov wrote:
> On Wed, 14 Jan 2015 15:27:27 +0800
> Zhu Guihua <zhugh.f...@cn.fujitsu.com> wrote:
> 
> > From: Gu Zheng <guz.f...@cn.fujitsu.com>
> > 
> > Use cc->get_arch_id as the cpu index to avoid the cpu index duplicated
> > issue in the QMP/HMP command output.
> > 
> > Signed-off-by: Gu Zheng <guz.f...@cn.fujitsu.com>
> > Signed-off-by: Zhu Guihua <zhugh.f...@cn.fujitsu.com>
> > ---
> >  cpus.c    | 4 +++-
> >  monitor.c | 4 +++-
> >  2 files changed, 6 insertions(+), 2 deletions(-)
> > 
> > diff --git a/cpus.c b/cpus.c
> > index 2edb5cd..d5e35c0 100644
> > --- a/cpus.c
> > +++ b/cpus.c
> > @@ -1420,6 +1420,7 @@ CpuInfoList *qmp_query_cpus(Error **errp)
> >  
> >      CPU_FOREACH(cpu) {
> >          CpuInfoList *info;
> > +        CPUClass *cc;
> >  #if defined(TARGET_I386)
> >          X86CPU *x86_cpu = X86_CPU(cpu);
> >          CPUX86State *env = &x86_cpu->env;
> > @@ -1437,11 +1438,12 @@ CpuInfoList *qmp_query_cpus(Error **errp)
> >          CPUTriCoreState *env = &tricore_cpu->env;
> >  #endif
> >  
> > +        cc = CPU_GET_CLASS(cpu);
> >          cpu_synchronize_state(cpu);
> >  
> >          info = g_malloc0(sizeof(*info));
> >          info->value = g_malloc0(sizeof(*info->value));
> > -        info->value->CPU = cpu->cpu_index;
> > +        info->value->CPU = cc->get_arch_id(cpu);
> I'm not sure what impact sparse ID numbering would be on libvirt
> CCing libvirt folks so they could check it.

Libvirt is currently using only the "thread_id" field of the data
returned by the query-cpus QMP command.

One place where we currently treat the cpu ID space as continuous is in
the CPU hotplug and unplug API, but the unplug part is currently
obsolete as it uses only the very old HMP command.

At any rate, changing the "CPU" field shouldn't change anything that
libvirt relies on.

Peter


Attachment: signature.asc
Description: Digital signature

Reply via email to