[libvirt] [PATCH 16/22] qemu: Store typename from query-cpu-definitions in qemuCaps

Jiri Denemark jdenemar at redhat.com
Thu Oct 3 14:30:07 UTC 2019


On Thu, Oct 03, 2019 at 16:27:23 +0200, Peter Krempa wrote:
> On Thu, Oct 03, 2019 at 16:00:34 +0200, Jiri Denemark wrote:
> > We need to create a mapping between CPU model names and their
> > corresponding QOM types.
> > 
> > Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
> > ---
> >  src/qemu/qemu_capabilities.c                  |    4 +
> >  src/qemu/qemu_monitor.c                       |    2 +
> >  src/qemu/qemu_monitor.h                       |    1 +
> >  src/qemu/qemu_monitor_json.c                  |    4 +
> >  .../caps_2.10.0.aarch64.xml                   |  126 +-
> >  .../caps_2.10.0.ppc64.xml                     | 1734 ++++++++--------
> >  .../caps_2.10.0.s390x.xml                     |  264 +--
> >  .../caps_2.10.0.x86_64.xml                    |  132 +-
> >  .../caps_2.11.0.s390x.xml                     |  264 +--
> >  .../caps_2.11.0.x86_64.xml                    |  136 +-
> >  .../caps_2.12.0.aarch64.xml                   |  136 +-
> >  .../caps_2.12.0.ppc64.xml                     | 1750 ++++++++---------
> >  .../caps_2.12.0.s390x.xml                     |  264 +--
> >  .../caps_2.12.0.x86_64.xml                    |  180 +-
> >  .../qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 1734 ++++++++--------
> >  .../qemucapabilitiesdata/caps_2.9.0.s390x.xml |  256 +--
> >  .../caps_2.9.0.x86_64.xml                     |  128 +-
> >  .../qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 1750 ++++++++---------
> >  .../qemucapabilitiesdata/caps_3.0.0.s390x.xml |  272 +--
> >  .../caps_3.0.0.x86_64.xml                     |  184 +-
> >  .../qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 1750 ++++++++---------
> >  .../caps_3.1.0.x86_64.xml                     |  196 +-
> >  .../caps_4.0.0.aarch64.xml                    |  148 +-
> >  .../qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 1750 ++++++++---------
> >  .../qemucapabilitiesdata/caps_4.0.0.s390x.xml |  284 +--
> >  .../caps_4.0.0.x86_64.xml                     |  196 +-
> >  .../caps_4.1.0.x86_64.xml                     |  400 ++--
> >  .../caps_4.2.0.x86_64.xml                     |  400 ++--
> >  28 files changed, 7228 insertions(+), 7217 deletions(-)
> 
> [...]
> 
> > diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
> > index c2a2f6eee6..c0cd195496 100644
> > --- a/src/qemu/qemu_monitor_json.c
> > +++ b/src/qemu/qemu_monitor_json.c
> > @@ -5571,6 +5571,10 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon,
> >          if (VIR_STRDUP(cpu->name, tmp) < 0)
> >              return -1;
> >  
> > +        if ((tmp = virJSONValueObjectGetString(child, "typename")) &&
> 
> Should we copy the string only if it's not an empty string?

Definitely, I didn't notice QEMU reported empty typenames for some CPU
models.

Jirka




More information about the libvir-list mailing list