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/MCDGWIF2LZGKM5HYPE34QZVZPGTMQL7N/
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/MCDGWIF2LZGKM5HYPE34QZVZPGTMQL7N/ 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/MCDGWIF2LZGKM5HYPE34QZVZPGTMQL7N/
>
> 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/MCDGWIF2LZGKM5HYPE34QZVZPGTMQL7N/ > > > > 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/MCDGWIF2LZGKM5HYPE34QZVZPGTMQL7N/
>>>
>>> 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
© 2016 - 2025 Red Hat, Inc.