[libvirt] [PATCH 0/7] qemu: Report better host-model CPUs in domain caps

Jiri Denemark jdenemar at redhat.com
Wed Mar 8 13:46:21 UTC 2017


One of the main reasons for introducing host-model CPU definition in a
domain capabilities XML was the inability to express disabled features
in a host capabilities XML. That is, when a host CPU is, e.g., Haswell
without x2apic support, host capabilities XML will have to report it as
Westmere + a bunch of additional features., but we really want to use
Haswell - x2apic when creating a host-model CPU.

Unfortunately, I somehow forgot to do the last step and the code would
just copy the CPU definition found in the host capabilities XML. This
changed recently for new QEMU versions which allow us to query host CPU,
but any slightly older QEMU will not benefit from any change I did. This
patch makes sure the right CPU model is filled in the domain
capabilities even with old QEMU.

The issue was reported in
https://bugzilla.redhat.com/show_bug.cgi?id=1426456

Jiri Denemark (7):
  Do not format <arch> in guest CPU XML
  cpu: Replace cpuNodeData with virCPUGetHost
  cpu: Add virCPUType parameter to virCPUGetHost
  cpu: Add list of allowed CPU models to virCPUGetHost
  qemu: Refactor virQEMUCapsInitCPU
  qemu: Report better host-model CPUs in domain caps
  cputest: New test for Intel Core i7-4510U

 src/bhyve/bhyve_capabilities.c                     |  35 +---
 src/conf/cpu_conf.c                                |   2 +-
 src/cpu/cpu.c                                      | 100 ++++++++--
 src/cpu/cpu.h                                      |  16 +-
 src/cpu/cpu_arm.c                                  |   1 -
 src/cpu/cpu_ppc64.c                                |  30 +--
 src/cpu/cpu_s390.c                                 |   1 -
 src/cpu/cpu_x86.c                                  |  29 ++-
 src/libvirt_private.syms                           |   2 +-
 src/qemu/qemu_capabilities.c                       |  61 +++----
 src/qemu/qemu_capspriv.h                           |   5 +
 src/vmware/vmware_conf.c                           |  20 +-
 src/vz/vz_driver.c                                 |  22 +--
 tests/Makefile.am                                  |  11 +-
 tests/cputest.c                                    |   1 +
 tests/cputestdata/x86_64-cpuid-A10-5800K-guest.xml |   1 -
 tests/cputestdata/x86_64-cpuid-A10-5800K-json.xml  |   1 -
 tests/cputestdata/x86_64-cpuid-Atom-D510-guest.xml |   1 -
 tests/cputestdata/x86_64-cpuid-Atom-N450-guest.xml |   1 -
 .../x86_64-cpuid-Core-i5-2500-guest.xml            |   1 -
 .../cputestdata/x86_64-cpuid-Core-i5-2500-json.xml |   1 -
 .../x86_64-cpuid-Core-i5-2540M-guest.xml           |   1 -
 .../x86_64-cpuid-Core-i5-2540M-json.xml            |   1 -
 .../x86_64-cpuid-Core-i5-4670T-guest.xml           |   1 -
 .../x86_64-cpuid-Core-i5-4670T-json.xml            |   1 -
 .../x86_64-cpuid-Core-i5-6600-guest.xml            |   1 -
 .../cputestdata/x86_64-cpuid-Core-i5-6600-json.xml |   1 -
 .../x86_64-cpuid-Core-i7-2600-guest.xml            |   1 -
 .../cputestdata/x86_64-cpuid-Core-i7-2600-json.xml |   1 -
 .../x86_64-cpuid-Core-i7-3520M-guest.xml           |   1 -
 .../x86_64-cpuid-Core-i7-3740QM-guest.xml          |   1 -
 .../x86_64-cpuid-Core-i7-3740QM-json.xml           |   1 -
 .../x86_64-cpuid-Core-i7-3770-guest.xml            |   1 -
 .../cputestdata/x86_64-cpuid-Core-i7-3770-json.xml |   1 -
 .../x86_64-cpuid-Core-i7-4510U-guest.xml           |  29 +++
 .../x86_64-cpuid-Core-i7-4510U-host.xml            |  44 +++++
 .../x86_64-cpuid-Core-i7-4510U-json.xml            |  15 ++
 tests/cputestdata/x86_64-cpuid-Core-i7-4510U.json  | 203 +++++++++++++++++++++
 tests/cputestdata/x86_64-cpuid-Core-i7-4510U.xml   |  34 ++++
 .../x86_64-cpuid-Core-i7-4600U-guest.xml           |   1 -
 .../x86_64-cpuid-Core-i7-4600U-json.xml            |   1 -
 .../x86_64-cpuid-Core-i7-5600U-guest.xml           |   1 -
 .../x86_64-cpuid-Core-i7-5600U-json.xml            |   1 -
 .../cputestdata/x86_64-cpuid-Core2-E6850-guest.xml |   1 -
 .../cputestdata/x86_64-cpuid-Core2-E6850-json.xml  |   1 -
 .../cputestdata/x86_64-cpuid-Core2-Q9500-guest.xml |   1 -
 tests/cputestdata/x86_64-cpuid-FX-8150-guest.xml   |   1 -
 .../x86_64-cpuid-Opteron-1352-guest.xml            |   1 -
 .../x86_64-cpuid-Opteron-2350-guest.xml            |   1 -
 .../cputestdata/x86_64-cpuid-Opteron-2350-json.xml |   1 -
 .../x86_64-cpuid-Opteron-6234-guest.xml            |   1 -
 .../cputestdata/x86_64-cpuid-Opteron-6234-json.xml |   1 -
 .../x86_64-cpuid-Opteron-6282-guest.xml            |   1 -
 .../x86_64-cpuid-Pentium-P6100-guest.xml           |   1 -
 .../cputestdata/x86_64-cpuid-Phenom-B95-guest.xml  |   1 -
 tests/cputestdata/x86_64-cpuid-Phenom-B95-json.xml |   1 -
 tests/cputestdata/x86_64-cpuid-Xeon-5110-guest.xml |   1 -
 .../x86_64-cpuid-Xeon-E3-1245-guest.xml            |   1 -
 .../cputestdata/x86_64-cpuid-Xeon-E3-1245-json.xml |   1 -
 .../x86_64-cpuid-Xeon-E5-2630-guest.xml            |   1 -
 .../cputestdata/x86_64-cpuid-Xeon-E5-2630-json.xml |   1 -
 .../x86_64-cpuid-Xeon-E5-2650-guest.xml            |   1 -
 .../cputestdata/x86_64-cpuid-Xeon-E5-2650-json.xml |   1 -
 .../x86_64-cpuid-Xeon-E7-4820-guest.xml            |   1 -
 .../cputestdata/x86_64-cpuid-Xeon-E7-4820-json.xml |   1 -
 .../x86_64-cpuid-Xeon-E7-8890-guest.xml            |   1 -
 .../cputestdata/x86_64-cpuid-Xeon-W3520-guest.xml  |   1 -
 tests/cputestdata/x86_64-cpuid-Xeon-W3520-json.xml |   1 -
 .../cputestdata/x86_64-cpuid-Xeon-X5460-guest.xml  |   1 -
 tests/domaincapstest.c                             |   6 +
 tests/qemucpumock.c                                |  35 ++++
 tests/qemuxml2argvtest.c                           |   6 +-
 72 files changed, 560 insertions(+), 197 deletions(-)
 create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4510U-guest.xml
 create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4510U-host.xml
 create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4510U-json.xml
 create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4510U.json
 create mode 100644 tests/cputestdata/x86_64-cpuid-Core-i7-4510U.xml
 create mode 100644 tests/qemucpumock.c

-- 
2.12.0




More information about the libvir-list mailing list