[PATCH v5 34/36] qemu_driver: Support feature expansion via QEMU when baselining cpu

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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 8c6838f584..4149e4794a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -13843,6 +13843,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(proc->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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux