]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Ignore "ht" CPU feature
authorJiri Denemark <jdenemar@redhat.com>
Fri, 24 Oct 2025 12:17:56 +0000 (14:17 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 3 Nov 2025 11:33:26 +0000 (12:33 +0100)
commitba16113c76050a10bbccaae0192a0d30f97de5ae
treecad750adb43cb3e7aadbb7ad9e4a10fa5f5e1022
parent4d5c1bc24119e90dfbcdae6a120027e5c1ede608
qemu: Ignore "ht" CPU feature

The feature does not do anything, QEMU will always set it according to
the CPU topology completely ignoring what we asked for. Unfortunately,
the way the state of "ht" is reported changed in QEMU 10.0.0 (commit
c6bd2dd634208).

QEMU older than 10.0.0 would just report whatever was specified on the
command line totally ignoring the actual state of the feature visible to
a guest. But after the change QEMU reports ht=on in case it enabled "ht"
based on the CPU topology. In all other cases QEMU still reports the
state requested on the command line.

As a result of this change a domain with multiple CPU threads started on
QEMU < 10.0.0 could not be migrated to QEMU >= 10.0.0 unless "ht" was
explicitly enabled in the domain XML because libvirt would see "ht"
enabled on the destination, but disabled on the source (the guest would
see "ht" enabled in both cases anyway). Outgoing migration of domains
started on QEMU >= 10.0.0 is not affected.

To fix this issue we can completely ignore "ht" both in the domain XML
and in the CPU properties reported by QEMU. With this fix incoming
migration to QEMU >= 10.0.0 works again.

Fixes: https://gitlab.com/libvirt/libvirt/-/issues/821
Fixes: https://issues.redhat.com/browse/RHEL-104216
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
18 files changed:
src/qemu/qemu_capabilities.c
tests/qemuxmlconfdata/cpu-cache-disable3.x86_64-latest.args
tests/qemuxmlconfdata/cpu-check-default-partial.x86_64-latest.args
tests/qemuxmlconfdata/cpu-exact2-nofallback.x86_64-latest.args
tests/qemuxmlconfdata/cpu-exact2-nofallback.x86_64-latest.xml
tests/qemuxmlconfdata/cpu-exact2-nofallback.xml
tests/qemuxmlconfdata/cpu-exact2.x86_64-latest.args
tests/qemuxmlconfdata/cpu-exact2.x86_64-latest.xml
tests/qemuxmlconfdata/cpu-exact2.xml
tests/qemuxmlconfdata/cpu-host-model-cmt.x86_64-latest.args
tests/qemuxmlconfdata/cpu-host-model-vendor.x86_64-latest.args
tests/qemuxmlconfdata/cpu-minimum1.x86_64-latest.args
tests/qemuxmlconfdata/cpu-minimum2.x86_64-latest.args
tests/qemuxmlconfdata/cpu-phys-bits-emulate2.x86_64-latest.args
tests/qemuxmlconfdata/cpu-strict1.x86_64-latest.args
tests/qemuxmlconfdata/cpu-strict1.x86_64-latest.xml
tests/qemuxmlconfdata/cpu-strict1.xml
tests/qemuxmlconfdata/cpu-tsc-frequency.x86_64-latest.args