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 @@ - diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 9c517597bb..1d1683a038 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -8910,6 +8910,26 @@ qemuDomainDefCopy(virQEMUDriverPtr driver, } +int +qemuDomainMakeCPUMigratable(virCPUDefPtr cpu) +{ + if (cpu->mode == VIR_CPU_MODE_CUSTOM && + STREQ_NULLABLE(cpu->model, "Icelake-Server")) { + /* 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; +} + + static int qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver, virQEMUCapsPtr qemuCaps, @@ -9092,6 +9112,9 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver, if (!(def->cpu = virCPUDefCopy(origCPU))) goto cleanup; } + + if (qemuDomainMakeCPUMigratable(def->cpu) < 0) + goto cleanup; } format: diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 88d1acb64f..ab00b25789 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -1225,3 +1225,6 @@ qemuDomainValidateActualNetDef(const virDomainNetDef *net, int qemuDomainSupportsCheckpointsBlockjobs(virDomainObjPtr vm) G_GNUC_WARN_UNUSED_RESULT; + +int +qemuDomainMakeCPUMigratable(virCPUDefPtr cpu); diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c index 0bc0ee864d..6f56764242 100644 --- a/src/qemu/qemu_migration_cookie.c +++ b/src/qemu/qemu_migration_cookie.c @@ -535,6 +535,9 @@ qemuMigrationCookieAddCPU(qemuMigrationCookiePtr mig, if (!(mig->cpu = virCPUDefCopy(vm->def->cpu))) return -1; + if (qemuDomainMakeCPUMigratable(mig->cpu) < 0) + return -1; + mig->flags |= QEMU_MIGRATION_COOKIE_CPU; return 0; diff --git a/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-guest.xml b/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-guest.xml index 6ca2099b33..4676f3aa7d 100644 --- a/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-guest.xml +++ b/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-guest.xml @@ -32,5 +32,4 @@ - diff --git a/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-host.xml b/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-host.xml index 31af20bc85..35b9e39629 100644 --- a/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-host.xml +++ b/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-host.xml @@ -1,6 +1,6 @@ x86_64 - Icelake-Client + Icelake-Server Intel @@ -21,23 +21,14 @@ - - - - - - - - - diff --git a/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-json.xml b/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-json.xml index b043db58d7..ada11d2608 100644 --- a/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-json.xml +++ b/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-json.xml @@ -13,5 +13,4 @@ -