[PATCH 4/6] qemu_process: Always fix CPUs on reconnect

Jiri Denemark via Devel posted 6 patches 1 month, 1 week ago
[PATCH 4/6] qemu_process: Always fix CPUs on reconnect
Posted by Jiri Denemark via Devel 1 month, 1 week ago
From: Jiri Denemark <jdenemar@redhat.com>

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>
---
 src/qemu/qemu_process.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 330519fd2e..d93ea4058d 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -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);
     }
 
-- 
2.51.0
Re: [PATCH 4/6] qemu_process: Always fix CPUs on reconnect
Posted by Ján Tomko via Devel 1 month, 1 week ago
On a Thursday in 2025, Jiri Denemark via Devel wrote:
>From: Jiri Denemark <jdenemar@redhat.com>
>
>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>
>---
> src/qemu/qemu_process.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano