On Mon, Nov 11, 2019 at 09:35:37PM +0100, Jiri Denemark wrote:
The pconfig feature was enabled in QEMU by accident in 3.1.0. All
other
newer versions do not support it and it was removed from the
Icelake-Server CPU model in QEMU.
We don't normally change our CPU models even when QEMU does so to avoid
breaking migrations between different versions of libvirt. But we can
safely do so in this specific case. QEMU never supported enabling
pconfig so any domain which was able to start has pconfig disabled.
With a small compatibility hack which explicitly disables pconfig when
CPU model equals Icelake-Server in migratable domain definition, only
one migration scenario stays broken (and there's nothing we can do about
it): from any host to a host with libvirt < 5.10.0 and QEMU > 3.1.0.
https://bugzilla.redhat.com/show_bug.cgi?id=1749672
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/cpu_map/x86_Icelake-Server.xml | 1 -
src/qemu/qemu_domain.c | 23 +++++++++++++++++++
src/qemu/qemu_domain.h | 3 +++
src/qemu/qemu_migration_cookie.c | 3 +++
.../x86_64-cpuid-Ice-Lake-Server-guest.xml | 1 -
.../x86_64-cpuid-Ice-Lake-Server-host.xml | 11 +--------
.../x86_64-cpuid-Ice-Lake-Server-json.xml | 1 -
7 files changed, 30 insertions(+), 13 deletions(-)
diff --git a/src/cpu_map/x86_Icelake-Server.xml b/src/cpu_map/x86_Icelake-Server.xml
index ecd21cf5c7..a565371977 100644
--- a/src/cpu_map/x86_Icelake-Server.xml
+++ b/src/cpu_map/x86_Icelake-Server.xml
@@ -54,7 +54,6 @@
<feature name='pat'/>
<feature name='pcid'/>
<feature name='pclmuldq'/>
- <feature name='pconfig'/>
<feature name='pdpe1gb'/>
<feature name='pge'/>
<feature name='pku'/>
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 58a82fbd60..4a641019be 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -8921,6 +8921,26 @@ qemuDomainDefCopy(virQEMUDriverPtr driver,
}
+int
+qemuDomainMakeCPUMigratable(virCPUDefPtr cpu)
+{
+ if (cpu->mode == VIR_CPU_MODE_CUSTOM &&
+ STREQ_NULLABLE(cpu->model, "Icelake-Server")) {
This might need tweaking when we merge support for versioned CPU
I presume, but not a blocker for this series as is.
+ /* Originally Icelake-Server CPU model contained pconfig CPU
feature.
+ * It was never actually enabled and thus it was removed. To enable
+ * migration to QEMU 3.1.0 (with both new and old libvirt), we
+ * explicitly disable pconfig in migration XML (otherwise old libvirt
+ * would think it was implicitly enabled on the source). New libvirt
+ * will drop it from the XML before starting the domain on new QEMU.
+ */
+ if (virCPUDefUpdateFeature(cpu, "pconfig", VIR_CPU_FEATURE_DISABLE)
< 0)
+ return -1;
+ }
+
+ return 0;
+}
+
Regards,
Daniel
--
|:
https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|:
https://libvirt.org -o-
https://fstop138.berrange.com :|
|:
https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|