[PATCH v5 0/5] Disable Deprecated Features by Default on s390 CPU Models

Changelog v5 - dropped the "none" test in qemuxmlactivetest (see commit for details) - reordered patches to introduce some tests first, then add qemu.conf changes v4 - added qemu.conf option to dictate the default behavior for the deprecated_features attribute (Boris) - added qemuxmlactivetests (Boris) - snuck in missing documentation for deprecated_features in formatdomain.rst v3 - added qemu caps check to avoid breaking s390 guests trying to default deprecated_features='off' on QEMU versions that do not support reporting these features v2 - changed behavior from disabling features on the host model to instead flagging the guest CPU to disable deprecated features - removed disabling deprecated features on host model in virQEMUCapsInitCPUModelS390 - added flagging deprecated_feats in qemuProcessUpdateGuestCPU - added tests for deprecated_features='on' - split virQEMUCapsUpdateCPUDeprecatedFeatures update and qemuProcessUpdateGuestCPU changes The intention of reporting deprecated features and modifying the guest CPU model was to alleviate the user from the burden of preparing a guest with the necessary amendments to assure migration to newer hardware. While that goal was met by way of the "deprecated_features='on|off'" attribute, it still adds an extra step that the user must be aware to prepare a guest for migration and the errors that stem from an unsuccessful migration (due to feature incompatibility) is not always clear how to resolve. These patches make s390 CPU *host models* migration ready from the get-go by introducing a qemu.conf option for disabling deprecated features by default. They may still be disabled for other model types via the respective attribute, or reenabled if desired. The configured behavior may be overridden by explicitly providing the attribute within the guest XML. Boris Fiuczynski (2): tests: new qemuxmlactive tests for s390x qemu: add default_cpu_deprecated_features configuration option Collin Walling (3): docs: domain: document deprecated_features attribute qemu: caps: add virCPUFeaturePolicy param to virQEMUCapsUpdateCPUDeprecatedFeatures qemu: process: refactor deprecated features code docs/formatdomain.rst | 8 ++++ src/qemu/libvirtd_qemu.aug | 3 ++ src/qemu/qemu.conf.in | 14 ++++++ src/qemu/qemu_capabilities.c | 6 +-- src/qemu/qemu_capabilities.h | 3 +- src/qemu/qemu_conf.c | 33 +++++++++++++ src/qemu/qemu_conf.h | 12 +++++ src/qemu/qemu_driver.c | 3 +- src/qemu/qemu_process.c | 46 +++++++++++++++---- src/qemu/test_libvirtd_qemu.aug.in | 1 + ...cated-features-off-active.s390x-latest.xml | 25 ++++++++++ ...ted-features-off-inactive.s390x-latest.xml | 25 ++++++++++ ...ecated-features-on-active.s390x-latest.xml | 25 ++++++++++ ...ated-features-on-inactive.s390x-latest.xml | 25 ++++++++++ tests/qemuxmlactivetest.c | 10 +++- ...deprecated-features-none.s390x-latest.args | 32 +++++++++++++ ...-deprecated-features-none.s390x-latest.xml | 25 ++++++++++ .../cpu-model-deprecated-features-none.xml | 15 ++++++ ...l-deprecated-features-on.s390x-latest.args | 32 +++++++++++++ ...el-deprecated-features-on.s390x-latest.xml | 25 ++++++++++ .../cpu-model-deprecated-features-on.xml | 15 ++++++ ...default-video-type-s390x.s390x-latest.args | 2 +- ...vfio-zpci-ccw-memballoon.s390x-latest.args | 2 +- .../launch-security-s390-pv.s390x-latest.args | 2 +- ...t-cpu-kvm-ccw-virtio-4.2.s390x-latest.args | 2 +- .../s390-defaultconsole.s390x-latest.args | 2 +- .../s390-panic.s390x-latest.args | 2 +- tests/qemuxmlconftest.c | 2 + 28 files changed, 375 insertions(+), 22 deletions(-) create mode 100644 tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-off-active.s390x-latest.xml create mode 100644 tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-off-inactive.s390x-latest.xml create mode 100644 tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-on-active.s390x-latest.xml create mode 100644 tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-on-inactive.s390x-latest.xml create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.args create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.xml create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-none.xml create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-on.s390x-latest.args create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-on.s390x-latest.xml create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-on.xml -- 2.49.0

Provide documentation for the deprecated_features XML attribute. Available since 11.0.0, and supported for S390. Signed-off-by: Collin Walling <walling@linux.ibm.com> --- docs/formatdomain.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 9a2f065590..cd316ac272 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1674,6 +1674,14 @@ In case no restrictions need to be put on CPU model and its features, a simpler </cpu> ... +``deprecated_features`` + :since:`Since 11.0.0`, S390 guests may utilize the ``deprecated_features`` + attribute to specify toggling of CPU model features that are flagged as + deprecated by the hypervisor. When this attribute is set to ``off``, the + active guest XML will reflect the respective features with the disable + policy. When this attribute is set to ``on``, the respective features will + be enabled. + ``cache`` :since:`Since 3.3.0` the ``cache`` element describes the virtual CPU cache. If the element is missing, the hypervisor will use a sensible default. -- 2.49.0

Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com> On 6/30/25 05:19, Collin Walling wrote:
Provide documentation for the deprecated_features XML attribute. Available since 11.0.0, and supported for S390.
Signed-off-by: Collin Walling <walling@linux.ibm.com> --- docs/formatdomain.rst | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 9a2f065590..cd316ac272 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1674,6 +1674,14 @@ In case no restrictions need to be put on CPU model and its features, a simpler </cpu> ...
+``deprecated_features`` + :since:`Since 11.0.0`, S390 guests may utilize the ``deprecated_features`` + attribute to specify toggling of CPU model features that are flagged as + deprecated by the hypervisor. When this attribute is set to ``off``, the + active guest XML will reflect the respective features with the disable + policy. When this attribute is set to ``on``, the respective features will + be enabled. + ``cache`` :since:`Since 3.3.0` the ``cache`` element describes the virtual CPU cache. If the element is missing, the hypervisor will use a sensible default.
-- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Wolfgang Wendt Geschäftsführung: David Faller Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

Currently, virQEMUCapsUpdateCPUDeprecatedFeatures only allows for disabling deprecated features. This locks the deprecated_features attribute to only do something if set to 'off'. Let's add a virCPUFeaturePolicy to the function's parameters which will allow the caller to decide what happens to these features. Add a test with guest XML using deprecated_features='on' to ensure the API is working properly. Signed-off-by: Collin Walling <walling@linux.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com> --- src/qemu/qemu_capabilities.c | 6 ++-- src/qemu/qemu_capabilities.h | 3 +- src/qemu/qemu_driver.c | 3 +- src/qemu/qemu_process.c | 9 ++++-- ...l-deprecated-features-on.s390x-latest.args | 32 +++++++++++++++++++ ...el-deprecated-features-on.s390x-latest.xml | 25 +++++++++++++++ .../cpu-model-deprecated-features-on.xml | 15 +++++++++ tests/qemuxmlconftest.c | 1 + 8 files changed, 87 insertions(+), 7 deletions(-) create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-on.s390x-latest.args create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-on.s390x-latest.xml create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-on.xml diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index b02f8e7a01..52ad80a9ca 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3366,7 +3366,8 @@ virQEMUCapsGetCPUFeatures(virQEMUCaps *qemuCaps, void virQEMUCapsUpdateCPUDeprecatedFeatures(virQEMUCaps *qemuCaps, virDomainVirtType virtType, - virCPUDef *cpu) + virCPUDef *cpu, + virCPUFeaturePolicy policy) { qemuMonitorCPUModelInfo *modelInfo; size_t i; @@ -3377,8 +3378,7 @@ virQEMUCapsUpdateCPUDeprecatedFeatures(virQEMUCaps *qemuCaps, return; for (i = 0; i < g_strv_length(modelInfo->deprecated_props); i++) { - virCPUDefUpdateFeature(cpu, modelInfo->deprecated_props[i], - VIR_CPU_FEATURE_DISABLE); + virCPUDefUpdateFeature(cpu, modelInfo->deprecated_props[i], policy); } } diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 966e30fa11..a044bda918 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -787,7 +787,8 @@ int virQEMUCapsGetCPUFeatures(virQEMUCaps *qemuCaps, char ***features); void virQEMUCapsUpdateCPUDeprecatedFeatures(virQEMUCaps *qemuCaps, virDomainVirtType virtType, - virCPUDef *cpu); + virCPUDef *cpu, + virCPUFeaturePolicy policy); virDomainVirtType virQEMUCapsGetVirtType(virQEMUCaps *qemuCaps); diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 9b583ad7aa..c6139d02a1 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -16720,7 +16720,8 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn, if (flags & VIR_CONNECT_GET_DOMAIN_CAPABILITIES_DISABLE_DEPRECATED_FEATURES) { virQEMUCapsUpdateCPUDeprecatedFeatures(qemuCaps, virttype, - domCaps->cpu.hostModel); + domCaps->cpu.hostModel, + VIR_CPU_FEATURE_DISABLE); } return virDomainCapsFormat(domCaps); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 82cab3f76e..e6124b670a 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6455,8 +6455,13 @@ qemuProcessUpdateGuestCPU(virDomainDef *def, return -1; } - if (def->cpu->deprecated_feats == VIR_TRISTATE_SWITCH_OFF) { - virQEMUCapsUpdateCPUDeprecatedFeatures(qemuCaps, def->virtType, def->cpu); + if (def->cpu->deprecated_feats) { + virCPUFeaturePolicy policy = VIR_CPU_FEATURE_REQUIRE; + if (def->cpu->deprecated_feats == VIR_TRISTATE_SWITCH_OFF) + policy = VIR_CPU_FEATURE_DISABLE; + + virQEMUCapsUpdateCPUDeprecatedFeatures(qemuCaps, def->virtType, + def->cpu, policy); } return 0; diff --git a/tests/qemuxmlconfdata/cpu-model-deprecated-features-on.s390x-latest.args b/tests/qemuxmlconfdata/cpu-model-deprecated-features-on.s390x-latest.args new file mode 100644 index 0000000000..8cdb2a2ac2 --- /dev/null +++ b/tests/qemuxmlconfdata/cpu-model-deprecated-features-on.s390x-latest.args @@ -0,0 +1,32 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-s390x \ +-name guest=guest,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \ +-accel kvm \ +-cpu gen16a-base,nnpa=on,aen=on,cmmnt=on,vxpdeh=on,aefsi=on,diag318=on,csske=on,mepoch=on,msa9=on,msa8=on,msa7=on,msa6=on,msa5=on,msa4=on,msa3=on,msa2=on,msa1=on,sthyi=on,edat=on,ri=on,deflate=on,edat2=on,etoken=on,vx=on,ipter=on,pai=on,paie=on,mepochptff=on,ap=on,vxeh=on,vxpd=on,esop=on,msa9_pckmo=on,vxeh2=on,esort=on,appv=on,apqi=on,apft=on,els=on,iep=on,appvi=on,apqci=on,cte=on,ais=on,bpb=on,ctop=on,gs=on,ppa15=on,zpci=on,rdp=on,sea_esop2=on,beareh=on,te=on,cmm=on,vxpdeh2=on \ +-m size=219136k \ +-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":224395264}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 22782664-6b93-46bf-9595-317220dd2d1c \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0000"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/cpu-model-deprecated-features-on.s390x-latest.xml b/tests/qemuxmlconfdata/cpu-model-deprecated-features-on.s390x-latest.xml new file mode 100644 index 0000000000..3bea664f40 --- /dev/null +++ b/tests/qemuxmlconfdata/cpu-model-deprecated-features-on.s390x-latest.xml @@ -0,0 +1,25 @@ +<domain type='kvm'> + <name>guest</name> + <uuid>22782664-6b93-46bf-9595-317220dd2d1c</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='host-model' check='partial' deprecated_features='on'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='pci' index='0' model='pci-root'/> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/cpu-model-deprecated-features-on.xml b/tests/qemuxmlconfdata/cpu-model-deprecated-features-on.xml new file mode 100644 index 0000000000..a5b11a41df --- /dev/null +++ b/tests/qemuxmlconfdata/cpu-model-deprecated-features-on.xml @@ -0,0 +1,15 @@ +<domain type='kvm'> + <name>guest</name> + <uuid>22782664-6b93-46bf-9595-317220dd2d1c</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + </os> + <cpu mode='host-model' check='partial' deprecated_features='on'/> + <clock offset='utc'/> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + </devices> +</domain> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 6ad4d90934..0ecfdf7e45 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2291,6 +2291,7 @@ mymain(void) DO_TEST_CAPS_ARCH_VER_FAILURE("cpu-model-deprecated-features-off", "s390x", "8.2.0"); DO_TEST_CAPS_ARCH_LATEST("cpu-model-deprecated-features-off", "s390x"); + DO_TEST_CAPS_ARCH_LATEST("cpu-model-deprecated-features-on", "s390x"); DO_TEST_CAPS_ARCH_LATEST_FULL("cpu-Haswell", "x86_64", ARG_CAPS_HOST_CPU_MODEL, QEMU_CPU_DEF_HASWELL); DO_TEST_CAPS_ARCH_LATEST_FULL("cpu-Haswell2", "x86_64", ARG_CAPS_HOST_CPU_MODEL, QEMU_CPU_DEF_HASWELL); -- 2.49.0

Group up the deprecated features code into a single block to keep things clean; only check if the deprecated_features attribute is present once and then do relevent work. Signed-off-by: Collin Walling <walling@linux.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com> --- src/qemu/qemu_process.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index e6124b670a..7155742d13 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6448,18 +6448,17 @@ qemuProcessUpdateGuestCPU(virDomainDef *def, &def->os.arch) < 0) return -1; - if (def->cpu->deprecated_feats && - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_DEPRECATED_PROPS)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("toggling deprecated features for CPU model is unsupported")); - return -1; - } - if (def->cpu->deprecated_feats) { virCPUFeaturePolicy policy = VIR_CPU_FEATURE_REQUIRE; if (def->cpu->deprecated_feats == VIR_TRISTATE_SWITCH_OFF) policy = VIR_CPU_FEATURE_DISABLE; + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_DEPRECATED_PROPS)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("toggling deprecated features for CPU model is unsupported")); + return -1; + } + virQEMUCapsUpdateCPUDeprecatedFeatures(qemuCaps, def->virtType, def->cpu, policy); } -- 2.49.0

From: Boris Fiuczynski <fiuczy@linux.ibm.com> Add tests for active/inactive XML with deprecated_features attribute. Note that for the qemuxmlactivetest, it is not possible to test an inactive guest XML with the absence of "deprecated_features" attribute and expect the active XML to have the attribute present. This is due to the fact that the tests never touch the code path in qemu_process that trigger this change in the domain definition. Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Collin Walling <walling@linux.ibm.com> --- ...cated-features-off-active.s390x-latest.xml | 25 +++++++++++++++ ...ted-features-off-inactive.s390x-latest.xml | 25 +++++++++++++++ ...ecated-features-on-active.s390x-latest.xml | 25 +++++++++++++++ ...ated-features-on-inactive.s390x-latest.xml | 25 +++++++++++++++ tests/qemuxmlactivetest.c | 10 ++++-- ...deprecated-features-none.s390x-latest.args | 32 +++++++++++++++++++ ...-deprecated-features-none.s390x-latest.xml | 25 +++++++++++++++ .../cpu-model-deprecated-features-none.xml | 15 +++++++++ tests/qemuxmlconftest.c | 1 + 9 files changed, 181 insertions(+), 2 deletions(-) create mode 100644 tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-off-active.s390x-latest.xml create mode 100644 tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-off-inactive.s390x-latest.xml create mode 100644 tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-on-active.s390x-latest.xml create mode 100644 tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-on-inactive.s390x-latest.xml create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.args create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.xml create mode 100644 tests/qemuxmlconfdata/cpu-model-deprecated-features-none.xml diff --git a/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-off-active.s390x-latest.xml b/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-off-active.s390x-latest.xml new file mode 100644 index 0000000000..c5761b1f89 --- /dev/null +++ b/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-off-active.s390x-latest.xml @@ -0,0 +1,25 @@ +<domain type='kvm' id='1337'> + <name>guest</name> + <uuid>22782664-6b93-46bf-9595-317220dd2d1c</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='host-model' check='partial' deprecated_features='off'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='pci' index='0' model='pci-root'/> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-off-inactive.s390x-latest.xml b/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-off-inactive.s390x-latest.xml new file mode 100644 index 0000000000..fdd87acb1d --- /dev/null +++ b/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-off-inactive.s390x-latest.xml @@ -0,0 +1,25 @@ +<domain type='kvm'> + <name>guest</name> + <uuid>22782664-6b93-46bf-9595-317220dd2d1c</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='host-model' check='partial' deprecated_features='off'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='pci' index='0' model='pci-root'/> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-on-active.s390x-latest.xml b/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-on-active.s390x-latest.xml new file mode 100644 index 0000000000..789b7ba018 --- /dev/null +++ b/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-on-active.s390x-latest.xml @@ -0,0 +1,25 @@ +<domain type='kvm' id='1337'> + <name>guest</name> + <uuid>22782664-6b93-46bf-9595-317220dd2d1c</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='host-model' check='partial' deprecated_features='on'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='pci' index='0' model='pci-root'/> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-on-inactive.s390x-latest.xml b/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-on-inactive.s390x-latest.xml new file mode 100644 index 0000000000..3bea664f40 --- /dev/null +++ b/tests/qemuxmlactive2xmldata/cpu-model-deprecated-features-on-inactive.s390x-latest.xml @@ -0,0 +1,25 @@ +<domain type='kvm'> + <name>guest</name> + <uuid>22782664-6b93-46bf-9595-317220dd2d1c</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='host-model' check='partial' deprecated_features='on'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='pci' index='0' model='pci-root'/> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlactivetest.c b/tests/qemuxmlactivetest.c index de2b1e48eb..44e66a4a29 100644 --- a/tests/qemuxmlactivetest.c +++ b/tests/qemuxmlactivetest.c @@ -232,9 +232,12 @@ mymain(void) virSetConnectSecret(conn); virSetConnectStorage(conn); +#define DO_TEST_ACTIVE_CAPS_ARCH_LATEST(_name, arch) \ + testRunActive(_name, "." arch "-latest", &testConf, &ret, \ + ARG_CAPS_ARCH, arch, ARG_CAPS_VER, "latest", ARG_END); + #define DO_TEST_ACTIVE_CAPS_LATEST(_name) \ - testRunActive(_name, ".x86_64-latest", &testConf, &ret, \ - ARG_CAPS_ARCH, "x86_64", ARG_CAPS_VER, "latest", ARG_END); + DO_TEST_ACTIVE_CAPS_ARCH_LATEST(_name, "x86_64"); DO_TEST_ACTIVE_CAPS_LATEST("channel-unix-source-path"); DO_TEST_ACTIVE_CAPS_LATEST("channel-virtio-state"); @@ -247,6 +250,9 @@ mymain(void) DO_TEST_ACTIVE_CAPS_LATEST("graphics-vnc-remove-generated-socket"); DO_TEST_ACTIVE_CAPS_LATEST("seclabel-static-labelskip"); + DO_TEST_ACTIVE_CAPS_ARCH_LATEST("cpu-model-deprecated-features-on", "s390x"); + DO_TEST_ACTIVE_CAPS_ARCH_LATEST("cpu-model-deprecated-features-off", "s390x"); + #define DO_TEST_STATUS(_name) \ do { \ if (testRunStatus(_name, &testConf, ARG_END) < 0) \ diff --git a/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.args b/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.args new file mode 100644 index 0000000000..8cdb2a2ac2 --- /dev/null +++ b/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.args @@ -0,0 +1,32 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-s390x \ +-name guest=guest,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \ +-accel kvm \ +-cpu gen16a-base,nnpa=on,aen=on,cmmnt=on,vxpdeh=on,aefsi=on,diag318=on,csske=on,mepoch=on,msa9=on,msa8=on,msa7=on,msa6=on,msa5=on,msa4=on,msa3=on,msa2=on,msa1=on,sthyi=on,edat=on,ri=on,deflate=on,edat2=on,etoken=on,vx=on,ipter=on,pai=on,paie=on,mepochptff=on,ap=on,vxeh=on,vxpd=on,esop=on,msa9_pckmo=on,vxeh2=on,esort=on,appv=on,apqi=on,apft=on,els=on,iep=on,appvi=on,apqci=on,cte=on,ais=on,bpb=on,ctop=on,gs=on,ppa15=on,zpci=on,rdp=on,sea_esop2=on,beareh=on,te=on,cmm=on,vxpdeh2=on \ +-m size=219136k \ +-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":224395264}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 22782664-6b93-46bf-9595-317220dd2d1c \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0000"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.xml b/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.xml new file mode 100644 index 0000000000..e4d688ab44 --- /dev/null +++ b/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.xml @@ -0,0 +1,25 @@ +<domain type='kvm'> + <name>guest</name> + <uuid>22782664-6b93-46bf-9595-317220dd2d1c</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='host-model' check='partial'/> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='pci' index='0' model='pci-root'/> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.xml b/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.xml new file mode 100644 index 0000000000..5b3c57adb2 --- /dev/null +++ b/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.xml @@ -0,0 +1,15 @@ +<domain type='kvm'> + <name>guest</name> + <uuid>22782664-6b93-46bf-9595-317220dd2d1c</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + </os> + <cpu mode='host-model' check='partial'/> + <clock offset='utc'/> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + </devices> +</domain> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 0ecfdf7e45..7f82a478da 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2292,6 +2292,7 @@ mymain(void) DO_TEST_CAPS_ARCH_VER_FAILURE("cpu-model-deprecated-features-off", "s390x", "8.2.0"); DO_TEST_CAPS_ARCH_LATEST("cpu-model-deprecated-features-off", "s390x"); DO_TEST_CAPS_ARCH_LATEST("cpu-model-deprecated-features-on", "s390x"); + DO_TEST_CAPS_ARCH_LATEST("cpu-model-deprecated-features-none", "s390x"); DO_TEST_CAPS_ARCH_LATEST_FULL("cpu-Haswell", "x86_64", ARG_CAPS_HOST_CPU_MODEL, QEMU_CPU_DEF_HASWELL); DO_TEST_CAPS_ARCH_LATEST_FULL("cpu-Haswell2", "x86_64", ARG_CAPS_HOST_CPU_MODEL, QEMU_CPU_DEF_HASWELL); -- 2.49.0

From: Boris Fiuczynski <fiuczy@linux.ibm.com> Allow to define the default for deprecated_features when the attribute is not set in the cpu defintion of a domain XML. If these features are still desired, they may be reenabled via the deprecated_features='on' attribute. Some existing tests utilize this updated behavior, so update the CPU features on the corresponding args files. Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Signed-off-by: Collin Walling <walling@linux.ibm.com> --- src/qemu/libvirtd_qemu.aug | 3 ++ src/qemu/qemu.conf.in | 14 ++++++++ src/qemu/qemu_conf.c | 33 +++++++++++++++++++ src/qemu/qemu_conf.h | 12 +++++++ src/qemu/qemu_process.c | 26 ++++++++++++++- src/qemu/test_libvirtd_qemu.aug.in | 1 + ...deprecated-features-none.s390x-latest.args | 2 +- ...default-video-type-s390x.s390x-latest.args | 2 +- ...vfio-zpci-ccw-memballoon.s390x-latest.args | 2 +- .../launch-security-s390-pv.s390x-latest.args | 2 +- ...t-cpu-kvm-ccw-virtio-4.2.s390x-latest.args | 2 +- .../s390-defaultconsole.s390x-latest.args | 2 +- .../s390-panic.s390x-latest.args | 2 +- 13 files changed, 95 insertions(+), 8 deletions(-) diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug index e1e479d72c..2b674d258d 100644 --- a/src/qemu/libvirtd_qemu.aug +++ b/src/qemu/libvirtd_qemu.aug @@ -160,6 +160,8 @@ module Libvirtd_qemu = let filesystem_entry = str_array_entry "shared_filesystems" + let default_cpu_deprecated_features = str_entry "default_cpu_deprecated_features" + (* Entries that used to exist in the config which are now * deleted. We keep on parsing them so we don't break * ability to parse old configs after upgrade @@ -192,6 +194,7 @@ module Libvirtd_qemu = | capability_filters_entry | storage_entry | filesystem_entry + | default_cpu_deprecated_features | obsolete_entry let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n][^\n]*)?/ . del /\n/ "\n" ] diff --git a/src/qemu/qemu.conf.in b/src/qemu/qemu.conf.in index 221bfa8095..368d929f78 100644 --- a/src/qemu/qemu.conf.in +++ b/src/qemu/qemu.conf.in @@ -1100,3 +1100,17 @@ # "/path/to/nvram", # "/path/to/swtpm" #] + +# If QEMU provides a list of deprecated CPU features it is possible to use +# this list for removal of deprecated CPU features during CPU model expansion. +# The deprecated_features XML attribute on the XML CPU element in the domain +# XML can be used to turn deprecated CPU features 'off' or 'on'. Using the +# option default_cpu_deprecated_features allows to define the default behavior +# when the attribute deprecated_features is not provided in the domain XML. +# +# Possible options are: +# "off" - (default) deprecated features are removed during CPU model expansion +# "on" - deprecated features remain required in the expanded CPU model +# "none" - no deprecated_features attribute is added to expanded CPU model +# +#default_cpu_deprecated_features = "off" diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 9bf12fc179..a9089ed0b9 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -81,6 +81,11 @@ VIR_ENUM_IMPL(virQEMUSchedCore, "emulator", "full"); +VIR_ENUM_IMPL(virQEMUDeprecatedFeatures, + QEMU_DEPRECATED_FEATURES_LAST, + "off", + "on", + "none"); static virClass *virQEMUDriverConfigClass; static void virQEMUDriverConfigDispose(void *obj); @@ -1258,6 +1263,31 @@ virQEMUDriverConfigLoadFilesystemEntry(virQEMUDriverConfig *cfg, } +static int +virQEMUDriverConfigLoadDeprecatedFeaturesEntry(virQEMUDriverConfig *cfg, + virConf *conf) +{ + g_autofree char *depFeats = NULL; + + if (virConfGetValueString(conf, "default_cpu_deprecated_features", &depFeats) < 0) + return -1; + if (depFeats) { + int val = virQEMUDeprecatedFeaturesTypeFromString(depFeats); + + if (val < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Unknown default_cpu_deprecated_features value %1$s"), + depFeats); + return -1; + } + + cfg->defaultDeprecatedFeatures = val; + } + + return 0; +} + + int virQEMUDriverConfigLoadFile(virQEMUDriverConfig *cfg, const char *filename, bool privileged) @@ -1338,6 +1368,9 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfig *cfg, if (virQEMUDriverConfigLoadFilesystemEntry(cfg, conf) < 0) return -1; + if (virQEMUDriverConfigLoadDeprecatedFeaturesEntry(cfg, conf) < 0) + return -1; + return 0; } diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index 1ce9dbe4a8..9db7678fce 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -58,6 +58,16 @@ typedef enum { VIR_ENUM_DECL(virQEMUSchedCore); +typedef enum { + QEMU_DEPRECATED_FEATURES_OFF = 0, + QEMU_DEPRECATED_FEATURES_ON, + QEMU_DEPRECATED_FEATURES_NONE, + + QEMU_DEPRECATED_FEATURES_LAST +} virQEMUDeprecatedFeatures; + +VIR_ENUM_DECL(virQEMUDeprecatedFeatures); + typedef struct _virQEMUDriver virQEMUDriver; typedef struct _virQEMUDriverConfig virQEMUDriverConfig; @@ -250,6 +260,8 @@ struct _virQEMUDriverConfig { virQEMUSchedCore schedCore; char **sharedFilesystems; + + virQEMUDeprecatedFeatures defaultDeprecatedFeatures; }; G_DEFINE_AUTOPTR_CLEANUP_FUNC(virQEMUDriverConfig, virObjectUnref); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 7155742d13..c210a69c9f 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6362,6 +6362,7 @@ static int qemuProcessUpdateGuestCPU(virDomainDef *def, virQEMUCaps *qemuCaps, virArch hostarch, + virQEMUDriverConfig *cfg, unsigned int flags) { if (!def->cpu) @@ -6407,6 +6408,29 @@ qemuProcessUpdateGuestCPU(virDomainDef *def, return -1; } + /* s390 CPU models should disable deprecated features for host-models by + * default if supported by QEMU. Set the flag now so the appropriate + * features are updated later. + */ + if (ARCH_IS_S390(def->os.arch) && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_DEPRECATED_PROPS) && + def->cpu->mode == VIR_CPU_MODE_HOST_MODEL && + !def->cpu->deprecated_feats) { + switch (cfg->defaultDeprecatedFeatures) { + case QEMU_DEPRECATED_FEATURES_OFF: + def->cpu->deprecated_feats = VIR_TRISTATE_SWITCH_OFF; + break; + case QEMU_DEPRECATED_FEATURES_ON: + def->cpu->deprecated_feats = VIR_TRISTATE_SWITCH_ON; + break; + case QEMU_DEPRECATED_FEATURES_NONE: + def->cpu->deprecated_feats = VIR_TRISTATE_SWITCH_ABSENT; + break; + case QEMU_DEPRECATED_FEATURES_LAST: + break; + } + } + /* nothing to update for host-passthrough / maximum */ if (def->cpu->mode != VIR_CPU_MODE_HOST_PASSTHROUGH && def->cpu->mode != VIR_CPU_MODE_MAXIMUM) { @@ -6861,7 +6885,7 @@ qemuProcessPrepareDomain(virQEMUDriver *driver, priv->pausedReason = VIR_DOMAIN_PAUSED_UNKNOWN; VIR_DEBUG("Updating guest CPU definition"); - if (qemuProcessUpdateGuestCPU(vm->def, priv->qemuCaps, driver->hostarch, flags) < 0) + if (qemuProcessUpdateGuestCPU(vm->def, priv->qemuCaps, driver->hostarch, cfg, flags) < 0) return -1; for (i = 0; i < vm->def->nshmems; i++) diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qemu.aug.in index 88d1a6aca1..08c825aa40 100644 --- a/src/qemu/test_libvirtd_qemu.aug.in +++ b/src/qemu/test_libvirtd_qemu.aug.in @@ -136,3 +136,4 @@ module Test_libvirtd_qemu = { "2" = "/path/to/nvram" } { "3" = "/path/to/swtpm" } } +{ "default_cpu_deprecated_features" = "off" } diff --git a/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.args b/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.args index 8cdb2a2ac2..ba6e7c5304 100644 --- a/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.args +++ b/tests/qemuxmlconfdata/cpu-model-deprecated-features-none.s390x-latest.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ -machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \ -accel kvm \ --cpu gen16a-base,nnpa=on,aen=on,cmmnt=on,vxpdeh=on,aefsi=on,diag318=on,csske=on,mepoch=on,msa9=on,msa8=on,msa7=on,msa6=on,msa5=on,msa4=on,msa3=on,msa2=on,msa1=on,sthyi=on,edat=on,ri=on,deflate=on,edat2=on,etoken=on,vx=on,ipter=on,pai=on,paie=on,mepochptff=on,ap=on,vxeh=on,vxpd=on,esop=on,msa9_pckmo=on,vxeh2=on,esort=on,appv=on,apqi=on,apft=on,els=on,iep=on,appvi=on,apqci=on,cte=on,ais=on,bpb=on,ctop=on,gs=on,ppa15=on,zpci=on,rdp=on,sea_esop2=on,beareh=on,te=on,cmm=on,vxpdeh2=on \ +-cpu gen16a-base,nnpa=on,aen=on,cmmnt=on,vxpdeh=on,aefsi=on,diag318=on,csske=off,mepoch=on,msa9=on,msa8=on,msa7=on,msa6=on,msa5=on,msa4=on,msa3=on,msa2=on,msa1=on,sthyi=on,edat=on,ri=on,deflate=on,edat2=on,etoken=on,vx=on,ipter=on,pai=on,paie=on,mepochptff=on,ap=on,vxeh=on,vxpd=on,esop=on,msa9_pckmo=on,vxeh2=on,esort=on,appv=on,apqi=on,apft=on,els=on,iep=on,appvi=on,apqci=on,cte=off,ais=on,bpb=off,ctop=on,gs=on,ppa15=on,zpci=on,rdp=on,sea_esop2=on,beareh=on,te=off,cmm=on,vxpdeh2=on \ -m size=219136k \ -object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":224395264}' \ -overcommit mem-lock=off \ diff --git a/tests/qemuxmlconfdata/default-video-type-s390x.s390x-latest.args b/tests/qemuxmlconfdata/default-video-type-s390x.s390x-latest.args index 1c1a1066e4..ff71f5b872 100644 --- a/tests/qemuxmlconfdata/default-video-type-s390x.s390x-latest.args +++ b/tests/qemuxmlconfdata/default-video-type-s390x.s390x-latest.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-default-video-type-s/.config \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-default-video-type-s/master-key.aes"}' \ -machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \ -accel kvm \ --cpu gen16a-base,nnpa=on,aen=on,cmmnt=on,vxpdeh=on,aefsi=on,diag318=on,csske=on,mepoch=on,msa9=on,msa8=on,msa7=on,msa6=on,msa5=on,msa4=on,msa3=on,msa2=on,msa1=on,sthyi=on,edat=on,ri=on,deflate=on,edat2=on,etoken=on,vx=on,ipter=on,pai=on,paie=on,mepochptff=on,ap=on,vxeh=on,vxpd=on,esop=on,msa9_pckmo=on,vxeh2=on,esort=on,appv=on,apqi=on,apft=on,els=on,iep=on,appvi=on,apqci=on,cte=on,ais=on,bpb=on,ctop=on,gs=on,ppa15=on,zpci=on,rdp=on,sea_esop2=on,beareh=on,te=on,cmm=on,vxpdeh2=on \ +-cpu gen16a-base,nnpa=on,aen=on,cmmnt=on,vxpdeh=on,aefsi=on,diag318=on,csske=off,mepoch=on,msa9=on,msa8=on,msa7=on,msa6=on,msa5=on,msa4=on,msa3=on,msa2=on,msa1=on,sthyi=on,edat=on,ri=on,deflate=on,edat2=on,etoken=on,vx=on,ipter=on,pai=on,paie=on,mepochptff=on,ap=on,vxeh=on,vxpd=on,esop=on,msa9_pckmo=on,vxeh2=on,esort=on,appv=on,apqi=on,apft=on,els=on,iep=on,appvi=on,apqci=on,cte=off,ais=on,bpb=off,ctop=on,gs=on,ppa15=on,zpci=on,rdp=on,sea_esop2=on,beareh=on,te=off,cmm=on,vxpdeh2=on \ -m size=1048576k \ -object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":1073741824}' \ -overcommit mem-lock=off \ diff --git a/tests/qemuxmlconfdata/hostdev-vfio-zpci-ccw-memballoon.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-vfio-zpci-ccw-memballoon.s390x-latest.args index d69ebfc8fd..25c0ed2c9c 100644 --- a/tests/qemuxmlconfdata/hostdev-vfio-zpci-ccw-memballoon.s390x-latest.args +++ b/tests/qemuxmlconfdata/hostdev-vfio-zpci-ccw-memballoon.s390x-latest.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-KVMGuest1/.config \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-KVMGuest1/master-key.aes"}' \ -machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \ -accel kvm \ --cpu gen16a-base,nnpa=on,aen=on,cmmnt=on,vxpdeh=on,aefsi=on,diag318=on,csske=on,mepoch=on,msa9=on,msa8=on,msa7=on,msa6=on,msa5=on,msa4=on,msa3=on,msa2=on,msa1=on,sthyi=on,edat=on,ri=on,deflate=on,edat2=on,etoken=on,vx=on,ipter=on,pai=on,paie=on,mepochptff=on,ap=on,vxeh=on,vxpd=on,esop=on,msa9_pckmo=on,vxeh2=on,esort=on,appv=on,apqi=on,apft=on,els=on,iep=on,appvi=on,apqci=on,cte=on,ais=on,bpb=on,ctop=on,gs=on,ppa15=on,zpci=on,rdp=on,sea_esop2=on,beareh=on,te=on,cmm=on,vxpdeh2=on \ +-cpu gen16a-base,nnpa=on,aen=on,cmmnt=on,vxpdeh=on,aefsi=on,diag318=on,csske=off,mepoch=on,msa9=on,msa8=on,msa7=on,msa6=on,msa5=on,msa4=on,msa3=on,msa2=on,msa1=on,sthyi=on,edat=on,ri=on,deflate=on,edat2=on,etoken=on,vx=on,ipter=on,pai=on,paie=on,mepochptff=on,ap=on,vxeh=on,vxpd=on,esop=on,msa9_pckmo=on,vxeh2=on,esort=on,appv=on,apqi=on,apft=on,els=on,iep=on,appvi=on,apqci=on,cte=off,ais=on,bpb=off,ctop=on,gs=on,ppa15=on,zpci=on,rdp=on,sea_esop2=on,beareh=on,te=off,cmm=on,vxpdeh2=on \ -m size=219136k \ -object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":224395264}' \ -overcommit mem-lock=off \ diff --git a/tests/qemuxmlconfdata/launch-security-s390-pv.s390x-latest.args b/tests/qemuxmlconfdata/launch-security-s390-pv.s390x-latest.args index 4f052238e9..4c80d0bf39 100644 --- a/tests/qemuxmlconfdata/launch-security-s390-pv.s390x-latest.args +++ b/tests/qemuxmlconfdata/launch-security-s390-pv.s390x-latest.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ -machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram,confidential-guest-support=lsec0 \ -accel kvm \ --cpu gen16a-base,nnpa=on,aen=on,cmmnt=on,vxpdeh=on,aefsi=on,diag318=on,csske=on,mepoch=on,msa9=on,msa8=on,msa7=on,msa6=on,msa5=on,msa4=on,msa3=on,msa2=on,msa1=on,sthyi=on,edat=on,ri=on,deflate=on,edat2=on,etoken=on,vx=on,ipter=on,pai=on,paie=on,mepochptff=on,ap=on,vxeh=on,vxpd=on,esop=on,msa9_pckmo=on,vxeh2=on,esort=on,appv=on,apqi=on,apft=on,els=on,iep=on,appvi=on,apqci=on,cte=on,ais=on,bpb=on,ctop=on,gs=on,ppa15=on,zpci=on,rdp=on,sea_esop2=on,beareh=on,te=on,cmm=on,vxpdeh2=on \ +-cpu gen16a-base,nnpa=on,aen=on,cmmnt=on,vxpdeh=on,aefsi=on,diag318=on,csske=off,mepoch=on,msa9=on,msa8=on,msa7=on,msa6=on,msa5=on,msa4=on,msa3=on,msa2=on,msa1=on,sthyi=on,edat=on,ri=on,deflate=on,edat2=on,etoken=on,vx=on,ipter=on,pai=on,paie=on,mepochptff=on,ap=on,vxeh=on,vxpd=on,esop=on,msa9_pckmo=on,vxeh2=on,esort=on,appv=on,apqi=on,apft=on,els=on,iep=on,appvi=on,apqci=on,cte=off,ais=on,bpb=off,ctop=on,gs=on,ppa15=on,zpci=on,rdp=on,sea_esop2=on,beareh=on,te=off,cmm=on,vxpdeh2=on \ -m size=219136k \ -object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":224395264}' \ -overcommit mem-lock=off \ diff --git a/tests/qemuxmlconfdata/s390-default-cpu-kvm-ccw-virtio-4.2.s390x-latest.args b/tests/qemuxmlconfdata/s390-default-cpu-kvm-ccw-virtio-4.2.s390x-latest.args index a6d8ba5952..3f3de9a668 100644 --- a/tests/qemuxmlconfdata/s390-default-cpu-kvm-ccw-virtio-4.2.s390x-latest.args +++ b/tests/qemuxmlconfdata/s390-default-cpu-kvm-ccw-virtio-4.2.s390x-latest.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-test/master-key.aes"}' \ -machine s390-ccw-virtio-4.2,usb=off,dump-guest-core=off,memory-backend=s390.ram \ -accel kvm \ --cpu gen16a-base,nnpa=on,aen=on,cmmnt=on,vxpdeh=on,aefsi=on,diag318=on,csske=on,mepoch=on,msa9=on,msa8=on,msa7=on,msa6=on,msa5=on,msa4=on,msa3=on,msa2=on,msa1=on,sthyi=on,edat=on,ri=on,deflate=on,edat2=on,etoken=on,vx=on,ipter=on,pai=on,paie=on,mepochptff=on,ap=on,vxeh=on,vxpd=on,esop=on,msa9_pckmo=on,vxeh2=on,esort=on,appv=on,apqi=on,apft=on,els=on,iep=on,appvi=on,apqci=on,cte=on,ais=on,bpb=on,ctop=on,gs=on,ppa15=on,zpci=on,rdp=on,sea_esop2=on,beareh=on,te=on,cmm=on,vxpdeh2=on \ +-cpu gen16a-base,nnpa=on,aen=on,cmmnt=on,vxpdeh=on,aefsi=on,diag318=on,csske=off,mepoch=on,msa9=on,msa8=on,msa7=on,msa6=on,msa5=on,msa4=on,msa3=on,msa2=on,msa1=on,sthyi=on,edat=on,ri=on,deflate=on,edat2=on,etoken=on,vx=on,ipter=on,pai=on,paie=on,mepochptff=on,ap=on,vxeh=on,vxpd=on,esop=on,msa9_pckmo=on,vxeh2=on,esort=on,appv=on,apqi=on,apft=on,els=on,iep=on,appvi=on,apqci=on,cte=off,ais=on,bpb=off,ctop=on,gs=on,ppa15=on,zpci=on,rdp=on,sea_esop2=on,beareh=on,te=off,cmm=on,vxpdeh2=on \ -m size=262144k \ -object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":268435456}' \ -overcommit mem-lock=off \ diff --git a/tests/qemuxmlconfdata/s390-defaultconsole.s390x-latest.args b/tests/qemuxmlconfdata/s390-defaultconsole.s390x-latest.args index e56d48ac36..3efa883d8c 100644 --- a/tests/qemuxmlconfdata/s390-defaultconsole.s390x-latest.args +++ b/tests/qemuxmlconfdata/s390-defaultconsole.s390x-latest.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-test/master-key.aes"}' \ -machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \ -accel kvm \ --cpu gen16a-base,nnpa=on,aen=on,cmmnt=on,vxpdeh=on,aefsi=on,diag318=on,csske=on,mepoch=on,msa9=on,msa8=on,msa7=on,msa6=on,msa5=on,msa4=on,msa3=on,msa2=on,msa1=on,sthyi=on,edat=on,ri=on,deflate=on,edat2=on,etoken=on,vx=on,ipter=on,pai=on,paie=on,mepochptff=on,ap=on,vxeh=on,vxpd=on,esop=on,msa9_pckmo=on,vxeh2=on,esort=on,appv=on,apqi=on,apft=on,els=on,iep=on,appvi=on,apqci=on,cte=on,ais=on,bpb=on,ctop=on,gs=on,ppa15=on,zpci=on,rdp=on,sea_esop2=on,beareh=on,te=on,cmm=on,vxpdeh2=on \ +-cpu gen16a-base,nnpa=on,aen=on,cmmnt=on,vxpdeh=on,aefsi=on,diag318=on,csske=off,mepoch=on,msa9=on,msa8=on,msa7=on,msa6=on,msa5=on,msa4=on,msa3=on,msa2=on,msa1=on,sthyi=on,edat=on,ri=on,deflate=on,edat2=on,etoken=on,vx=on,ipter=on,pai=on,paie=on,mepochptff=on,ap=on,vxeh=on,vxpd=on,esop=on,msa9_pckmo=on,vxeh2=on,esort=on,appv=on,apqi=on,apft=on,els=on,iep=on,appvi=on,apqci=on,cte=off,ais=on,bpb=off,ctop=on,gs=on,ppa15=on,zpci=on,rdp=on,sea_esop2=on,beareh=on,te=off,cmm=on,vxpdeh2=on \ -m size=262144k \ -object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":268435456}' \ -overcommit mem-lock=off \ diff --git a/tests/qemuxmlconfdata/s390-panic.s390x-latest.args b/tests/qemuxmlconfdata/s390-panic.s390x-latest.args index c5e4c9245e..8afd5de0f6 100644 --- a/tests/qemuxmlconfdata/s390-panic.s390x-latest.args +++ b/tests/qemuxmlconfdata/s390-panic.s390x-latest.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-test/master-key.aes"}' \ -machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \ -accel kvm \ --cpu gen16a-base,nnpa=on,aen=on,cmmnt=on,vxpdeh=on,aefsi=on,diag318=on,csske=on,mepoch=on,msa9=on,msa8=on,msa7=on,msa6=on,msa5=on,msa4=on,msa3=on,msa2=on,msa1=on,sthyi=on,edat=on,ri=on,deflate=on,edat2=on,etoken=on,vx=on,ipter=on,pai=on,paie=on,mepochptff=on,ap=on,vxeh=on,vxpd=on,esop=on,msa9_pckmo=on,vxeh2=on,esort=on,appv=on,apqi=on,apft=on,els=on,iep=on,appvi=on,apqci=on,cte=on,ais=on,bpb=on,ctop=on,gs=on,ppa15=on,zpci=on,rdp=on,sea_esop2=on,beareh=on,te=on,cmm=on,vxpdeh2=on \ +-cpu gen16a-base,nnpa=on,aen=on,cmmnt=on,vxpdeh=on,aefsi=on,diag318=on,csske=off,mepoch=on,msa9=on,msa8=on,msa7=on,msa6=on,msa5=on,msa4=on,msa3=on,msa2=on,msa1=on,sthyi=on,edat=on,ri=on,deflate=on,edat2=on,etoken=on,vx=on,ipter=on,pai=on,paie=on,mepochptff=on,ap=on,vxeh=on,vxpd=on,esop=on,msa9_pckmo=on,vxeh2=on,esort=on,appv=on,apqi=on,apft=on,els=on,iep=on,appvi=on,apqci=on,cte=off,ais=on,bpb=off,ctop=on,gs=on,ppa15=on,zpci=on,rdp=on,sea_esop2=on,beareh=on,te=off,cmm=on,vxpdeh2=on \ -m size=262144k \ -object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":268435456}' \ -overcommit mem-lock=off \ -- 2.49.0

On Sun, Jun 29, 2025 at 11:19:30PM -0400, Collin Walling wrote:
From: Boris Fiuczynski <fiuczy@linux.ibm.com>
Allow to define the default for deprecated_features when the attribute is not set in the cpu defintion of a domain XML. If these features are still desired, they may be reenabled via the deprecated_features='on' attribute.
Some existing tests utilize this updated behavior, so update the CPU features on the corresponding args files.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Signed-off-by: Collin Walling <walling@linux.ibm.com> --- src/qemu/libvirtd_qemu.aug | 3 ++ src/qemu/qemu.conf.in | 14 ++++++++ src/qemu/qemu_conf.c | 33 +++++++++++++++++++ src/qemu/qemu_conf.h | 12 +++++++ src/qemu/qemu_process.c | 26 ++++++++++++++- src/qemu/test_libvirtd_qemu.aug.in | 1 + ...deprecated-features-none.s390x-latest.args | 2 +- ...default-video-type-s390x.s390x-latest.args | 2 +- ...vfio-zpci-ccw-memballoon.s390x-latest.args | 2 +- .../launch-security-s390-pv.s390x-latest.args | 2 +- ...t-cpu-kvm-ccw-virtio-4.2.s390x-latest.args | 2 +- .../s390-defaultconsole.s390x-latest.args | 2 +- .../s390-panic.s390x-latest.args | 2 +- 13 files changed, 95 insertions(+), 8 deletions(-)
diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug index e1e479d72c..2b674d258d 100644 --- a/src/qemu/libvirtd_qemu.aug +++ b/src/qemu/libvirtd_qemu.aug @@ -160,6 +160,8 @@ module Libvirtd_qemu =
let filesystem_entry = str_array_entry "shared_filesystems"
+ let default_cpu_deprecated_features = str_entry "default_cpu_deprecated_features" + (* Entries that used to exist in the config which are now * deleted. We keep on parsing them so we don't break * ability to parse old configs after upgrade @@ -192,6 +194,7 @@ module Libvirtd_qemu = | capability_filters_entry | storage_entry | filesystem_entry + | default_cpu_deprecated_features | obsolete_entry
let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n][^\n]*)?/ . del /\n/ "\n" ] diff --git a/src/qemu/qemu.conf.in b/src/qemu/qemu.conf.in index 221bfa8095..368d929f78 100644 --- a/src/qemu/qemu.conf.in +++ b/src/qemu/qemu.conf.in @@ -1100,3 +1100,17 @@ # "/path/to/nvram", # "/path/to/swtpm" #] + +# If QEMU provides a list of deprecated CPU features it is possible to use +# this list for removal of deprecated CPU features during CPU model expansion. +# The deprecated_features XML attribute on the XML CPU element in the domain +# XML can be used to turn deprecated CPU features 'off' or 'on'. Using the +# option default_cpu_deprecated_features allows to define the default behavior +# when the attribute deprecated_features is not provided in the domain XML. +# +# Possible options are: +# "off" - (default) deprecated features are removed during CPU model expansion +# "on" - deprecated features remain required in the expanded CPU model +# "none" - no deprecated_features attribute is added to expanded CPU model +# +#default_cpu_deprecated_features = "off"
Having a host level config parameter change the guest ABI seems like a bad idea to me. IMHO mgmt apps should be updated to use the XML to request deprecated features are turned off by default. With 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 :|

On 7/1/25 10:46, Daniel P. Berrangé via Devel wrote:
On Sun, Jun 29, 2025 at 11:19:30PM -0400, Collin Walling wrote:
From: Boris Fiuczynski <fiuczy@linux.ibm.com>
Allow to define the default for deprecated_features when the attribute is not set in the cpu defintion of a domain XML. If these features are still desired, they may be reenabled via the deprecated_features='on' attribute.
Some existing tests utilize this updated behavior, so update the CPU features on the corresponding args files.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Signed-off-by: Collin Walling <walling@linux.ibm.com> --- src/qemu/libvirtd_qemu.aug | 3 ++ src/qemu/qemu.conf.in | 14 ++++++++ src/qemu/qemu_conf.c | 33 +++++++++++++++++++ src/qemu/qemu_conf.h | 12 +++++++ src/qemu/qemu_process.c | 26 ++++++++++++++- src/qemu/test_libvirtd_qemu.aug.in | 1 + ...deprecated-features-none.s390x-latest.args | 2 +- ...default-video-type-s390x.s390x-latest.args | 2 +- ...vfio-zpci-ccw-memballoon.s390x-latest.args | 2 +- .../launch-security-s390-pv.s390x-latest.args | 2 +- ...t-cpu-kvm-ccw-virtio-4.2.s390x-latest.args | 2 +- .../s390-defaultconsole.s390x-latest.args | 2 +- .../s390-panic.s390x-latest.args | 2 +- 13 files changed, 95 insertions(+), 8 deletions(-)
diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug index e1e479d72c..2b674d258d 100644 --- a/src/qemu/libvirtd_qemu.aug +++ b/src/qemu/libvirtd_qemu.aug @@ -160,6 +160,8 @@ module Libvirtd_qemu =
let filesystem_entry = str_array_entry "shared_filesystems"
+ let default_cpu_deprecated_features = str_entry "default_cpu_deprecated_features" + (* Entries that used to exist in the config which are now * deleted. We keep on parsing them so we don't break * ability to parse old configs after upgrade @@ -192,6 +194,7 @@ module Libvirtd_qemu = | capability_filters_entry | storage_entry | filesystem_entry + | default_cpu_deprecated_features | obsolete_entry
let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n][^\n]*)?/ . del /\n/ "\n" ] diff --git a/src/qemu/qemu.conf.in b/src/qemu/qemu.conf.in index 221bfa8095..368d929f78 100644 --- a/src/qemu/qemu.conf.in +++ b/src/qemu/qemu.conf.in @@ -1100,3 +1100,17 @@ # "/path/to/nvram", # "/path/to/swtpm" #] + +# If QEMU provides a list of deprecated CPU features it is possible to use +# this list for removal of deprecated CPU features during CPU model expansion. +# The deprecated_features XML attribute on the XML CPU element in the domain +# XML can be used to turn deprecated CPU features 'off' or 'on'. Using the +# option default_cpu_deprecated_features allows to define the default behavior +# when the attribute deprecated_features is not provided in the domain XML. +# +# Possible options are: +# "off" - (default) deprecated features are removed during CPU model expansion +# "on" - deprecated features remain required in the expanded CPU model +# "none" - no deprecated_features attribute is added to expanded CPU model +# +#default_cpu_deprecated_features = "off"
Having a host level config parameter change the guest ABI seems like a bad idea to me. IMHO mgmt apps should be updated to use the XML to request deprecated features are turned off by default.
With regards, Daniel
Daniel, it has been some time but the idea originally is yours. https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/message/MCDG... The config parameter gives customers that still make use of the deprecated features in most of there guests the option to bail out of the default switch without having to edit all there guests. Of course they will give up a migrate to a CPU generation which no longer supports the cpu features to work out of the box. The default is switched in this patch to use deprecated_features = "off" which disables all deprecated cpu features without using of the config parameter. -- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Wolfgang Wendt Geschäftsführung: David Faller Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

On Tue, Jul 01, 2025 at 03:58:02PM +0200, Boris Fiuczynski wrote:
On 7/1/25 10:46, Daniel P. Berrangé via Devel wrote:
On Sun, Jun 29, 2025 at 11:19:30PM -0400, Collin Walling wrote:
From: Boris Fiuczynski <fiuczy@linux.ibm.com>
Allow to define the default for deprecated_features when the attribute is not set in the cpu defintion of a domain XML. If these features are still desired, they may be reenabled via the deprecated_features='on' attribute.
Some existing tests utilize this updated behavior, so update the CPU features on the corresponding args files.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Signed-off-by: Collin Walling <walling@linux.ibm.com> --- src/qemu/libvirtd_qemu.aug | 3 ++ src/qemu/qemu.conf.in | 14 ++++++++ src/qemu/qemu_conf.c | 33 +++++++++++++++++++ src/qemu/qemu_conf.h | 12 +++++++ src/qemu/qemu_process.c | 26 ++++++++++++++- src/qemu/test_libvirtd_qemu.aug.in | 1 + ...deprecated-features-none.s390x-latest.args | 2 +- ...default-video-type-s390x.s390x-latest.args | 2 +- ...vfio-zpci-ccw-memballoon.s390x-latest.args | 2 +- .../launch-security-s390-pv.s390x-latest.args | 2 +- ...t-cpu-kvm-ccw-virtio-4.2.s390x-latest.args | 2 +- .../s390-defaultconsole.s390x-latest.args | 2 +- .../s390-panic.s390x-latest.args | 2 +- 13 files changed, 95 insertions(+), 8 deletions(-)
diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug index e1e479d72c..2b674d258d 100644 --- a/src/qemu/libvirtd_qemu.aug +++ b/src/qemu/libvirtd_qemu.aug @@ -160,6 +160,8 @@ module Libvirtd_qemu = let filesystem_entry = str_array_entry "shared_filesystems" + let default_cpu_deprecated_features = str_entry "default_cpu_deprecated_features" + (* Entries that used to exist in the config which are now * deleted. We keep on parsing them so we don't break * ability to parse old configs after upgrade @@ -192,6 +194,7 @@ module Libvirtd_qemu = | capability_filters_entry | storage_entry | filesystem_entry + | default_cpu_deprecated_features | obsolete_entry let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n][^\n]*)?/ . del /\n/ "\n" ] diff --git a/src/qemu/qemu.conf.in b/src/qemu/qemu.conf.in index 221bfa8095..368d929f78 100644 --- a/src/qemu/qemu.conf.in +++ b/src/qemu/qemu.conf.in @@ -1100,3 +1100,17 @@ # "/path/to/nvram", # "/path/to/swtpm" #] + +# If QEMU provides a list of deprecated CPU features it is possible to use +# this list for removal of deprecated CPU features during CPU model expansion. +# The deprecated_features XML attribute on the XML CPU element in the domain +# XML can be used to turn deprecated CPU features 'off' or 'on'. Using the +# option default_cpu_deprecated_features allows to define the default behavior +# when the attribute deprecated_features is not provided in the domain XML. +# +# Possible options are: +# "off" - (default) deprecated features are removed during CPU model expansion +# "on" - deprecated features remain required in the expanded CPU model +# "none" - no deprecated_features attribute is added to expanded CPU model +# +#default_cpu_deprecated_features = "off"
Having a host level config parameter change the guest ABI seems like a bad idea to me. IMHO mgmt apps should be updated to use the XML to request deprecated features are turned off by default.
it has been some time but the idea originally is yours. https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/message/MCDG...
Sigh, I'm disagreeing with myself from a year ago :-( In that comment I was talking about host CPU model, where it is slightly acceptable for the expansion to vary over time. What I failed to contemplate when I wrote that, was that this applies to all CPU modes, even the named CPU models.
The config parameter gives customers that still make use of the deprecated features in most of there guests the option to bail out of the default switch without having to edit all there guests. Of course they will give up a migrate to a CPU generation which no longer supports the cpu features to work out of the box. The default is switched in this patch to use deprecated_features = "off" which disables all deprecated cpu features without using of the config parameter.
That change in defaults would effectively make the next libvirt version a regression compared to all previous versions, as CPU features would be disappearing, despite the guest config not changed meanwhile. With 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 :|

On 7/1/25 18:35, Daniel P. Berrangé via Devel wrote:
On Tue, Jul 01, 2025 at 03:58:02PM +0200, Boris Fiuczynski wrote:
On 7/1/25 10:46, Daniel P. Berrangé via Devel wrote:
On Sun, Jun 29, 2025 at 11:19:30PM -0400, Collin Walling wrote:
From: Boris Fiuczynski <fiuczy@linux.ibm.com>
Allow to define the default for deprecated_features when the attribute is not set in the cpu defintion of a domain XML. If these features are still desired, they may be reenabled via the deprecated_features='on' attribute.
Some existing tests utilize this updated behavior, so update the CPU features on the corresponding args files.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Signed-off-by: Collin Walling <walling@linux.ibm.com> --- src/qemu/libvirtd_qemu.aug | 3 ++ src/qemu/qemu.conf.in | 14 ++++++++ src/qemu/qemu_conf.c | 33 +++++++++++++++++++ src/qemu/qemu_conf.h | 12 +++++++ src/qemu/qemu_process.c | 26 ++++++++++++++- src/qemu/test_libvirtd_qemu.aug.in | 1 + ...deprecated-features-none.s390x-latest.args | 2 +- ...default-video-type-s390x.s390x-latest.args | 2 +- ...vfio-zpci-ccw-memballoon.s390x-latest.args | 2 +- .../launch-security-s390-pv.s390x-latest.args | 2 +- ...t-cpu-kvm-ccw-virtio-4.2.s390x-latest.args | 2 +- .../s390-defaultconsole.s390x-latest.args | 2 +- .../s390-panic.s390x-latest.args | 2 +- 13 files changed, 95 insertions(+), 8 deletions(-)
diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug index e1e479d72c..2b674d258d 100644 --- a/src/qemu/libvirtd_qemu.aug +++ b/src/qemu/libvirtd_qemu.aug @@ -160,6 +160,8 @@ module Libvirtd_qemu = let filesystem_entry = str_array_entry "shared_filesystems" + let default_cpu_deprecated_features = str_entry "default_cpu_deprecated_features" + (* Entries that used to exist in the config which are now * deleted. We keep on parsing them so we don't break * ability to parse old configs after upgrade @@ -192,6 +194,7 @@ module Libvirtd_qemu = | capability_filters_entry | storage_entry | filesystem_entry + | default_cpu_deprecated_features | obsolete_entry let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n][^\n]*)?/ . del /\n/ "\n" ] diff --git a/src/qemu/qemu.conf.in b/src/qemu/qemu.conf.in index 221bfa8095..368d929f78 100644 --- a/src/qemu/qemu.conf.in +++ b/src/qemu/qemu.conf.in @@ -1100,3 +1100,17 @@ # "/path/to/nvram", # "/path/to/swtpm" #] + +# If QEMU provides a list of deprecated CPU features it is possible to use +# this list for removal of deprecated CPU features during CPU model expansion. +# The deprecated_features XML attribute on the XML CPU element in the domain +# XML can be used to turn deprecated CPU features 'off' or 'on'. Using the +# option default_cpu_deprecated_features allows to define the default behavior +# when the attribute deprecated_features is not provided in the domain XML. +# +# Possible options are: +# "off" - (default) deprecated features are removed during CPU model expansion +# "on" - deprecated features remain required in the expanded CPU model +# "none" - no deprecated_features attribute is added to expanded CPU model +# +#default_cpu_deprecated_features = "off"
Having a host level config parameter change the guest ABI seems like a bad idea to me. IMHO mgmt apps should be updated to use the XML to request deprecated features are turned off by default.
it has been some time but the idea originally is yours. https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/message/MCDG...
Sigh, I'm disagreeing with myself from a year ago :-(
In that comment I was talking about host CPU model, where it is slightly acceptable for the expansion to vary over time. What I failed to contemplate when I wrote that, was that this applies to all CPU modes, even the named CPU models.
The config parameter gives customers that still make use of the deprecated features in most of there guests the option to bail out of the default switch without having to edit all there guests. Of course they will give up a migrate to a CPU generation which no longer supports the cpu features to work out of the box. The default is switched in this patch to use deprecated_features = "off" which disables all deprecated cpu features without using of the config parameter.
That change in defaults would effectively make the next libvirt version a regression compared to all previous versions, as CPU features would be disappearing, despite the guest config not changed meanwhile.
The default is only effective on s390x and if mode="host-model" is set. So that matches what you talked about. A user can specify deprecated_features manually in other scenarios but this series does not do that. -- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Wolfgang Wendt Geschäftsführung: David Faller Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

On Wed, Jul 02, 2025 at 12:05:45PM +0200, Boris Fiuczynski wrote:
On 7/1/25 18:35, Daniel P. Berrangé via Devel wrote:
On Tue, Jul 01, 2025 at 03:58:02PM +0200, Boris Fiuczynski wrote:
On 7/1/25 10:46, Daniel P. Berrangé via Devel wrote:
On Sun, Jun 29, 2025 at 11:19:30PM -0400, Collin Walling wrote:
From: Boris Fiuczynski <fiuczy@linux.ibm.com>
Allow to define the default for deprecated_features when the attribute is not set in the cpu defintion of a domain XML. If these features are still desired, they may be reenabled via the deprecated_features='on' attribute.
Some existing tests utilize this updated behavior, so update the CPU features on the corresponding args files.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Signed-off-by: Collin Walling <walling@linux.ibm.com> --- src/qemu/libvirtd_qemu.aug | 3 ++ src/qemu/qemu.conf.in | 14 ++++++++ src/qemu/qemu_conf.c | 33 +++++++++++++++++++ src/qemu/qemu_conf.h | 12 +++++++ src/qemu/qemu_process.c | 26 ++++++++++++++- src/qemu/test_libvirtd_qemu.aug.in | 1 + ...deprecated-features-none.s390x-latest.args | 2 +- ...default-video-type-s390x.s390x-latest.args | 2 +- ...vfio-zpci-ccw-memballoon.s390x-latest.args | 2 +- .../launch-security-s390-pv.s390x-latest.args | 2 +- ...t-cpu-kvm-ccw-virtio-4.2.s390x-latest.args | 2 +- .../s390-defaultconsole.s390x-latest.args | 2 +- .../s390-panic.s390x-latest.args | 2 +- 13 files changed, 95 insertions(+), 8 deletions(-)
diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug index e1e479d72c..2b674d258d 100644 --- a/src/qemu/libvirtd_qemu.aug +++ b/src/qemu/libvirtd_qemu.aug @@ -160,6 +160,8 @@ module Libvirtd_qemu = let filesystem_entry = str_array_entry "shared_filesystems" + let default_cpu_deprecated_features = str_entry "default_cpu_deprecated_features" + (* Entries that used to exist in the config which are now * deleted. We keep on parsing them so we don't break * ability to parse old configs after upgrade @@ -192,6 +194,7 @@ module Libvirtd_qemu = | capability_filters_entry | storage_entry | filesystem_entry + | default_cpu_deprecated_features | obsolete_entry let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n][^\n]*)?/ . del /\n/ "\n" ] diff --git a/src/qemu/qemu.conf.in b/src/qemu/qemu.conf.in index 221bfa8095..368d929f78 100644 --- a/src/qemu/qemu.conf.in +++ b/src/qemu/qemu.conf.in @@ -1100,3 +1100,17 @@ # "/path/to/nvram", # "/path/to/swtpm" #] + +# If QEMU provides a list of deprecated CPU features it is possible to use +# this list for removal of deprecated CPU features during CPU model expansion. +# The deprecated_features XML attribute on the XML CPU element in the domain +# XML can be used to turn deprecated CPU features 'off' or 'on'. Using the +# option default_cpu_deprecated_features allows to define the default behavior +# when the attribute deprecated_features is not provided in the domain XML. +# +# Possible options are: +# "off" - (default) deprecated features are removed during CPU model expansion +# "on" - deprecated features remain required in the expanded CPU model +# "none" - no deprecated_features attribute is added to expanded CPU model +# +#default_cpu_deprecated_features = "off"
Having a host level config parameter change the guest ABI seems like a bad idea to me. IMHO mgmt apps should be updated to use the XML to request deprecated features are turned off by default.
it has been some time but the idea originally is yours. https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/message/MCDG...
Sigh, I'm disagreeing with myself from a year ago :-(
In that comment I was talking about host CPU model, where it is slightly acceptable for the expansion to vary over time. What I failed to contemplate when I wrote that, was that this applies to all CPU modes, even the named CPU models.
The config parameter gives customers that still make use of the deprecated features in most of there guests the option to bail out of the default switch without having to edit all there guests. Of course they will give up a migrate to a CPU generation which no longer supports the cpu features to work out of the box. The default is switched in this patch to use deprecated_features = "off" which disables all deprecated cpu features without using of the config parameter.
That change in defaults would effectively make the next libvirt version a regression compared to all previous versions, as CPU features would be disappearing, despite the guest config not changed meanwhile.
The default is only effective on s390x and if mode="host-model" is set. So that matches what you talked about.
Oh sorry, I misread the patch in this respect. So no objection. Should we also apply to host-passthrough though ? Or is that already being filtered by the kernel ? With 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 :|

On 7/2/25 12:20, Daniel P. Berrangé via Devel wrote:
On Wed, Jul 02, 2025 at 12:05:45PM +0200, Boris Fiuczynski wrote:
On 7/1/25 18:35, Daniel P. Berrangé via Devel wrote:
On Tue, Jul 01, 2025 at 03:58:02PM +0200, Boris Fiuczynski wrote:
On 7/1/25 10:46, Daniel P. Berrangé via Devel wrote:
On Sun, Jun 29, 2025 at 11:19:30PM -0400, Collin Walling wrote:
From: Boris Fiuczynski <fiuczy@linux.ibm.com>
Allow to define the default for deprecated_features when the attribute is not set in the cpu defintion of a domain XML. If these features are still desired, they may be reenabled via the deprecated_features='on' attribute.
Some existing tests utilize this updated behavior, so update the CPU features on the corresponding args files.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Signed-off-by: Collin Walling <walling@linux.ibm.com> --- src/qemu/libvirtd_qemu.aug | 3 ++ src/qemu/qemu.conf.in | 14 ++++++++ src/qemu/qemu_conf.c | 33 +++++++++++++++++++ src/qemu/qemu_conf.h | 12 +++++++ src/qemu/qemu_process.c | 26 ++++++++++++++- src/qemu/test_libvirtd_qemu.aug.in | 1 + ...deprecated-features-none.s390x-latest.args | 2 +- ...default-video-type-s390x.s390x-latest.args | 2 +- ...vfio-zpci-ccw-memballoon.s390x-latest.args | 2 +- .../launch-security-s390-pv.s390x-latest.args | 2 +- ...t-cpu-kvm-ccw-virtio-4.2.s390x-latest.args | 2 +- .../s390-defaultconsole.s390x-latest.args | 2 +- .../s390-panic.s390x-latest.args | 2 +- 13 files changed, 95 insertions(+), 8 deletions(-)
diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug index e1e479d72c..2b674d258d 100644 --- a/src/qemu/libvirtd_qemu.aug +++ b/src/qemu/libvirtd_qemu.aug @@ -160,6 +160,8 @@ module Libvirtd_qemu = let filesystem_entry = str_array_entry "shared_filesystems" + let default_cpu_deprecated_features = str_entry "default_cpu_deprecated_features" + (* Entries that used to exist in the config which are now * deleted. We keep on parsing them so we don't break * ability to parse old configs after upgrade @@ -192,6 +194,7 @@ module Libvirtd_qemu = | capability_filters_entry | storage_entry | filesystem_entry + | default_cpu_deprecated_features | obsolete_entry let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n][^\n]*)?/ . del /\n/ "\n" ] diff --git a/src/qemu/qemu.conf.in b/src/qemu/qemu.conf.in index 221bfa8095..368d929f78 100644 --- a/src/qemu/qemu.conf.in +++ b/src/qemu/qemu.conf.in @@ -1100,3 +1100,17 @@ # "/path/to/nvram", # "/path/to/swtpm" #] + +# If QEMU provides a list of deprecated CPU features it is possible to use +# this list for removal of deprecated CPU features during CPU model expansion. +# The deprecated_features XML attribute on the XML CPU element in the domain +# XML can be used to turn deprecated CPU features 'off' or 'on'. Using the +# option default_cpu_deprecated_features allows to define the default behavior +# when the attribute deprecated_features is not provided in the domain XML. +# +# Possible options are: +# "off" - (default) deprecated features are removed during CPU model expansion +# "on" - deprecated features remain required in the expanded CPU model +# "none" - no deprecated_features attribute is added to expanded CPU model +# +#default_cpu_deprecated_features = "off"
Having a host level config parameter change the guest ABI seems like a bad idea to me. IMHO mgmt apps should be updated to use the XML to request deprecated features are turned off by default.
it has been some time but the idea originally is yours. https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/message/MCDG...
Sigh, I'm disagreeing with myself from a year ago :-(
In that comment I was talking about host CPU model, where it is slightly acceptable for the expansion to vary over time. What I failed to contemplate when I wrote that, was that this applies to all CPU modes, even the named CPU models.
The config parameter gives customers that still make use of the deprecated features in most of there guests the option to bail out of the default switch without having to edit all there guests. Of course they will give up a migrate to a CPU generation which no longer supports the cpu features to work out of the box. The default is switched in this patch to use deprecated_features = "off" which disables all deprecated cpu features without using of the config parameter.
That change in defaults would effectively make the next libvirt version a regression compared to all previous versions, as CPU features would be disappearing, despite the guest config not changed meanwhile.
The default is only effective on s390x and if mode="host-model" is set. So that matches what you talked about.
Oh sorry, I misread the patch in this respect. So no objection.
Should we also apply to host-passthrough though ? Or is that already being filtered by the kernel ?
I think it should not apply to host-passthrough. One can opt-in by manually adding deprecated_features. The main purpose of deprecated_features is to ensure migration to newer machine generations. Using host-passthrough is known to be not safe to migrate and disabling deprecated cpu features seems not to match passthrough, IMHO.
With regards, Daniel
-- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Wolfgang Wendt Geschäftsführung: David Faller Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

On 6/29/25 11:19 PM, Collin Walling wrote: Pinging this series once. Would like to know if there's any further feedback or if these patches are good enough. Thanks for your time. [...] -- Regards, Collin

On 6/29/25 23:19, Collin Walling wrote: Pinging again, since it's been about three weeks since the last bump. Unless these patches are satisfactory, please inform on what needs to change. -- Regards, Collin

On 30/06/2025 05.19, Collin Walling wrote:
Changelog
v5 - dropped the "none" test in qemuxmlactivetest (see commit for details) - reordered patches to introduce some tests first, then add qemu.conf changes
v4 - added qemu.conf option to dictate the default behavior for the deprecated_features attribute (Boris) - added qemuxmlactivetests (Boris) - snuck in missing documentation for deprecated_features in formatdomain.rst
v3 - added qemu caps check to avoid breaking s390 guests trying to default deprecated_features='off' on QEMU versions that do not support reporting these features
v2 - changed behavior from disabling features on the host model to instead flagging the guest CPU to disable deprecated features - removed disabling deprecated features on host model in virQEMUCapsInitCPUModelS390 - added flagging deprecated_feats in qemuProcessUpdateGuestCPU - added tests for deprecated_features='on' - split virQEMUCapsUpdateCPUDeprecatedFeatures update and qemuProcessUpdateGuestCPU changes
The intention of reporting deprecated features and modifying the guest CPU model was to alleviate the user from the burden of preparing a guest with the necessary amendments to assure migration to newer hardware. While that goal was met by way of the "deprecated_features='on|off'" attribute, it still adds an extra step that the user must be aware to prepare a guest for migration and the errors that stem from an unsuccessful migration (due to feature incompatibility) is not always clear how to resolve.
These patches make s390 CPU *host models* migration ready from the get-go by introducing a qemu.conf option for disabling deprecated features by default. They may still be disabled for other model types via the respective attribute, or reenabled if desired. The configured behavior may be overridden by explicitly providing the attribute within the guest XML.
The patch series sounds reasonable to me, so FWIW: Series Acked-by: Thomas Huth <thuth@redhat.com> Peter, Michal, could we still get this merged for libvirt 11.6 ? Thomas

On 7/24/25 03:35, Thomas Huth via Devel wrote:
On 30/06/2025 05.19, Collin Walling wrote:
Changelog
v5 - dropped the "none" test in qemuxmlactivetest (see commit for details) - reordered patches to introduce some tests first, then add qemu.conf changes
v4 - added qemu.conf option to dictate the default behavior for the deprecated_features attribute (Boris) - added qemuxmlactivetests (Boris) - snuck in missing documentation for deprecated_features in formatdomain.rst
v3 - added qemu caps check to avoid breaking s390 guests trying to default deprecated_features='off' on QEMU versions that do not support reporting these features
v2 - changed behavior from disabling features on the host model to instead flagging the guest CPU to disable deprecated features - removed disabling deprecated features on host model in virQEMUCapsInitCPUModelS390 - added flagging deprecated_feats in qemuProcessUpdateGuestCPU - added tests for deprecated_features='on' - split virQEMUCapsUpdateCPUDeprecatedFeatures update and qemuProcessUpdateGuestCPU changes
The intention of reporting deprecated features and modifying the guest CPU model was to alleviate the user from the burden of preparing a guest with the necessary amendments to assure migration to newer hardware. While that goal was met by way of the "deprecated_features='on|off'" attribute, it still adds an extra step that the user must be aware to prepare a guest for migration and the errors that stem from an unsuccessful migration (due to feature incompatibility) is not always clear how to resolve.
These patches make s390 CPU *host models* migration ready from the get-go by introducing a qemu.conf option for disabling deprecated features by default. They may still be disabled for other model types via the respective attribute, or reenabled if desired. The configured behavior may be overridden by explicitly providing the attribute within the guest XML.
The patch series sounds reasonable to me, so FWIW:
Series Acked-by: Thomas Huth <thuth@redhat.com>
Peter, Michal, could we still get this merged for libvirt 11.6 ?
Thomas
Thanks for the Ack and helping to move this along. I've posted a patch to the list for NEWS mentioning this features in case this series is accepted in time for 11.6. -- Regards, Collin

On Thu, Jul 24, 2025 at 14:39:02 -0400, Collin Walling wrote:
On 7/24/25 03:35, Thomas Huth via Devel wrote:
On 30/06/2025 05.19, Collin Walling wrote:
Changelog
v5 - dropped the "none" test in qemuxmlactivetest (see commit for details) - reordered patches to introduce some tests first, then add qemu.conf changes
v4 - added qemu.conf option to dictate the default behavior for the deprecated_features attribute (Boris) - added qemuxmlactivetests (Boris) - snuck in missing documentation for deprecated_features in formatdomain.rst
v3 - added qemu caps check to avoid breaking s390 guests trying to default deprecated_features='off' on QEMU versions that do not support reporting these features
v2 - changed behavior from disabling features on the host model to instead flagging the guest CPU to disable deprecated features - removed disabling deprecated features on host model in virQEMUCapsInitCPUModelS390 - added flagging deprecated_feats in qemuProcessUpdateGuestCPU - added tests for deprecated_features='on' - split virQEMUCapsUpdateCPUDeprecatedFeatures update and qemuProcessUpdateGuestCPU changes
The intention of reporting deprecated features and modifying the guest CPU model was to alleviate the user from the burden of preparing a guest with the necessary amendments to assure migration to newer hardware. While that goal was met by way of the "deprecated_features='on|off'" attribute, it still adds an extra step that the user must be aware to prepare a guest for migration and the errors that stem from an unsuccessful migration (due to feature incompatibility) is not always clear how to resolve.
These patches make s390 CPU *host models* migration ready from the get-go by introducing a qemu.conf option for disabling deprecated features by default. They may still be disabled for other model types via the respective attribute, or reenabled if desired. The configured behavior may be overridden by explicitly providing the attribute within the guest XML.
The patch series sounds reasonable to me, so FWIW:
Series Acked-by: Thomas Huth <thuth@redhat.com>
Peter, Michal, could we still get this merged for libvirt 11.6 ?
Thomas
Thanks for the Ack and helping to move this along.
I've posted a patch to the list for NEWS mentioning this features in case this series is accepted in time for 11.6.
Both this series and the NEWS patch are pushed now. Jirka

On 7/25/25 09:53, Jiri Denemark via Devel wrote:
On Thu, Jul 24, 2025 at 14:39:02 -0400, Collin Walling wrote:
On 7/24/25 03:35, Thomas Huth via Devel wrote:
On 30/06/2025 05.19, Collin Walling wrote:
Changelog
v5 - dropped the "none" test in qemuxmlactivetest (see commit for details) - reordered patches to introduce some tests first, then add qemu.conf changes
v4 - added qemu.conf option to dictate the default behavior for the deprecated_features attribute (Boris) - added qemuxmlactivetests (Boris) - snuck in missing documentation for deprecated_features in formatdomain.rst
v3 - added qemu caps check to avoid breaking s390 guests trying to default deprecated_features='off' on QEMU versions that do not support reporting these features
v2 - changed behavior from disabling features on the host model to instead flagging the guest CPU to disable deprecated features - removed disabling deprecated features on host model in virQEMUCapsInitCPUModelS390 - added flagging deprecated_feats in qemuProcessUpdateGuestCPU - added tests for deprecated_features='on' - split virQEMUCapsUpdateCPUDeprecatedFeatures update and qemuProcessUpdateGuestCPU changes
The intention of reporting deprecated features and modifying the guest CPU model was to alleviate the user from the burden of preparing a guest with the necessary amendments to assure migration to newer hardware. While that goal was met by way of the "deprecated_features='on|off'" attribute, it still adds an extra step that the user must be aware to prepare a guest for migration and the errors that stem from an unsuccessful migration (due to feature incompatibility) is not always clear how to resolve.
These patches make s390 CPU *host models* migration ready from the get-go by introducing a qemu.conf option for disabling deprecated features by default. They may still be disabled for other model types via the respective attribute, or reenabled if desired. The configured behavior may be overridden by explicitly providing the attribute within the guest XML.
The patch series sounds reasonable to me, so FWIW:
Series Acked-by: Thomas Huth <thuth@redhat.com>
Peter, Michal, could we still get this merged for libvirt 11.6 ?
Thomas
Thanks for the Ack and helping to move this along.
I've posted a patch to the list for NEWS mentioning this features in case this series is accepted in time for 11.6.
Both this series and the NEWS patch are pushed now.
Jirka
Thanks! -- Regards, Collin
participants (5)
-
Boris Fiuczynski
-
Collin Walling
-
Daniel P. Berrangé
-
Jiri Denemark
-
Thomas Huth