Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx> --- src/qemu/qemu_capabilities.c | 12 +++++++++++- src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml | 1 + 13 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 3f5ddbd34e..dab3665f07 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -585,6 +585,7 @@ VIR_ENUM_IMPL(virQEMUCaps, /* 370 */ "cpu.migratable", + "query-cpu-model-expansion.migratable", ); @@ -5041,9 +5042,18 @@ virQEMUCapsInitProcessCaps(virQEMUCapsPtr qemuCaps) virQEMUCapsClear(qemuCaps, QEMU_CAPS_DEVICE_NVDIMM); if (ARCH_IS_X86(qemuCaps->arch) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION)) + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION)) { virQEMUCapsSet(qemuCaps, QEMU_CAPS_CPU_CACHE); + /* Old x86 QEMU supported migratable:false property in + * query-cpu-model-expansion arguments even though it was not properly + * advertised as a CPU property. + */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_MIGRATABLE) || + qemuCaps->version < 2012000) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_MIGRATABLE); + } + if (ARCH_IS_S390(qemuCaps->arch)) { /* Legacy assurance for QEMU_CAPS_CCW */ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CCW) && diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index c07b3e6f08..f085e67e11 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -566,6 +566,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ /* 370 */ QEMU_CAPS_CPU_MIGRATABLE, /* -cpu ...,migratable=on|off */ + QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_MIGRATABLE, /* query-cpu-model-expansion supports migratable:false */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml index cb02723ada..8030de8b5f 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml @@ -185,6 +185,7 @@ <flag name='i8042'/> <flag name='tcg'/> <flag name='pvscsi'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>2010000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100287</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml index 5245fc77dc..cf927c0bd6 100644 --- a/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml @@ -191,6 +191,7 @@ <flag name='i8042'/> <flag name='tcg'/> <flag name='pvscsi'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>2011000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100288</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml index 1cb0957ed7..d9de98eca4 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml @@ -201,6 +201,7 @@ <flag name='tcg'/> <flag name='pvscsi'/> <flag name='cpu.migratable'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>2011090</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100289</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml index 122d9509f1..866d1062bf 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml @@ -179,6 +179,7 @@ <flag name='i8042'/> <flag name='tcg'/> <flag name='pvscsi'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>2009000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100247</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml index 10b2661fe3..ac8db37399 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml @@ -207,6 +207,7 @@ <flag name='tcg'/> <flag name='pvscsi'/> <flag name='cpu.migratable'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>3000000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100239</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml index 7ff47aa348..bc013ecc08 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml @@ -210,6 +210,7 @@ <flag name='tcg'/> <flag name='pvscsi'/> <flag name='cpu.migratable'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>3000092</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100240</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml index e9fdf9cb1e..d7fb3c2a14 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml @@ -215,6 +215,7 @@ <flag name='tcg'/> <flag name='pvscsi'/> <flag name='cpu.migratable'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>4000000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100240</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml index d57cedd0db..6f904b6ff4 100644 --- a/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.1.0.x86_64.xml @@ -221,6 +221,7 @@ <flag name='tcg'/> <flag name='pvscsi'/> <flag name='cpu.migratable'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>4001000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100241</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml index 2685c3219f..f0bb23d507 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml @@ -229,6 +229,7 @@ <flag name='tcg'/> <flag name='pvscsi'/> <flag name='cpu.migratable'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>4002000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100242</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml index 0355518cbe..e4bf738cb5 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml @@ -235,6 +235,7 @@ <flag name='virtio-blk-pci.scsi.default.disabled'/> <flag name='pvscsi'/> <flag name='cpu.migratable'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>5000000</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100241</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml index 906fec41ee..cec503308f 100644 --- a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml @@ -235,6 +235,7 @@ <flag name='virtio-blk-pci.scsi.default.disabled'/> <flag name='pvscsi'/> <flag name='cpu.migratable'/> + <flag name='query-cpu-model-expansion.migratable'/> <version>5000050</version> <kvmVersion>0</kvmVersion> <microcodeVersion>43100242</microcodeVersion> -- 2.27.0