Support using QEMU to do feature expansion when also using QEMU to
compute hypervisor baseline.
A QEMU process is already created to send the QMP messages to baseline
using QEMU.
The same QEMU process is used for the CPU feature expansion.
QEMU only returns migratable features when expanding CPU model in
architectures where QEMU is used for baseline so no attempt is made to
ask for non-migratable features in expansions when using QEMU for
baseline.
Signed-off-by: Chris Venteicher <cventeic(a)redhat.com>
---
src/qemu/qemu_driver.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 8b5c3e1fb5..73707cce46 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -13614,6 +13614,27 @@ qemuConnectBaselineHypervisorCPU(virConnectPtr conn,
if (flags & VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES) {
if (useLibvirt && virCPUExpandFeatures(arch, cpu) < 0) {
goto cleanup;
+ } else if (useQemu &&
+ virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION)) {
+
+ if (!(modelInfo = virQEMUCapsCPUModelInfoFromCPUDef(cpu)))
+ goto cleanup;
+
+ virCPUDefFree(cpu);
+ cpu = NULL;
+
+ /* QEMU can only include migratable features
+ for all archs that use QEMU for baseline calculation */
+ migratable = true;
+
+ if (qemuMonitorGetCPUModelExpansion(mon,
+ QEMU_MONITOR_CPU_MODEL_EXPANSION_FULL,
+ migratable, modelInfo, &expansion)
< 0)
+ goto cleanup;
+
+ if (!(cpu = virQEMUCapsCPUModelInfoToCPUDef(migratable, expansion)))
+ goto cleanup;
+
} else {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("expand features while "
--
2.17.1