]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_process: Always fix CPUs on reconnect
authorJiri Denemark <jdenemar@redhat.com>
Fri, 24 Oct 2025 13:36:18 +0000 (15:36 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 3 Nov 2025 11:33:26 +0000 (12:33 +0100)
We fix CPUs (i.e., remove ignored CPU features) only when libvirt/QEMU
combo used to start the domain is very old and doesn't support
query-cpu-model-expansion, in which case the CPU definition may contain
features that are unknown to QEMU. But even if both libvirt and QEMU are
new enough, we still want to remove features that do nothing to minimize
confusion or to avoid false migration issues.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_process.c

index 330519fd2e61f60f5f58e418b31bc7d732feef0a..d93ea4058d02a640dd0dfe3f0be503fea2b2d4b6 100644 (file)
@@ -9511,12 +9511,7 @@ qemuProcessRefreshCPU(virQEMUDriver *driver,
 
         if (qemuProcessUpdateCPU(vm, VIR_ASYNC_JOB_NONE) < 0)
             return -1;
-    } else if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION)) {
-        /* We only try to fix CPUs when the libvirt/QEMU combo used to start
-         * the domain did not know about query-cpu-model-expansion in which
-         * case the host-model is known to not contain features which QEMU
-         * doesn't know about.
-         */
+    } else {
         qemuDomainFixupCPUs(vm, priv->origCPU);
     }