]> git.ipfire.org Git - thirdparty/libvirt.git/commit
cpu_x86: Make sure removed features are always mentioned in CPU def
authorJiri Denemark <jdenemar@redhat.com>
Fri, 13 Nov 2020 22:13:44 +0000 (23:13 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 24 Nov 2020 19:13:23 +0000 (20:13 +0100)
commit7e0a3104982c5ba273316d6e39184d28c9f2fc9a
tree8fbe9eadc2fa0baca1d9f33216ac97e2fd83e5a9
parent52cbfb2186364b1ab64f56e1360dcbc7d8ab85c1
cpu_x86: Make sure removed features are always mentioned in CPU def

For backward compatibility with older versions of libvirt CPU models in
our CPU map are mostly immutable. We only changed them in a few specific
cases after showing it was safe. Sometimes QEMU developers realize a
specific feature should not be part of a particular (or any) CPU model
because it can never be enabled automatically without further
configuration. But we couldn't follow them because doing so would break
migration to older libvirt.

If QEMU drops feature F from CPU model M because F could not be enabled
automatically anyway, asking for M would never enable F. Even with older
QEMU versions. Naively removing F from libvirt's definition of M would
seem to work nicely on a single host. Libvirt would consider M to be
compatible with hosts CPU that do not support F. However, trying to
migrate domains using M without explicitly enabling or disabling F could
fail, because older libvirt would think F was enabled (it is part of M
there), but QEMU reports it as disabled once started.

Thus we can remove such feature from a libvirt's CPU model, but we have
to make sure any CPU definition using the affected model will always
explicitly mention the state of the removed feature.

https://bugzilla.redhat.com/show_bug.cgi?id=1798004

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
src/cpu/cpu_x86.c