When performing a static CPU model expansion, the reported list of
deprecated features will reflect the features which are currently
enabled on the CPU model.
Retrieve this subset and store them as static deprecated properties for
the model info, and as host deprecated features in the cache.
Note that this list may exclude items that are shown in the
<deprecatedFeatures> list, as some feature support has been dropped by
hardware (e.g. csske).
Signed-off-by: Collin Walling <walling@linux.ibm.com>
---
src/qemu/qemu_capabilities.c | 6 +++++-
src/qemu/qemu_monitor.c | 2 ++
src/qemu/qemu_monitor.h | 1 +
src/qemu/qemu_monitor_json.c | 17 +++++++++++++++--
.../qemucapabilitiesdata/caps_10.0.0_s390x.xml | 6 ++++++
tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml | 6 ++++++
tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml | 6 ++++++
7 files changed, 41 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 3243ba8ad3..2dfdedfa1a 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -4234,7 +4234,9 @@ virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsAccel *caps,
ctxt->node = hostCPUNode;
if (virQEMUCapsParseHostCPUModelInfoDepFeats(ctxt, &hostCPU->full_dep_props,
- "./deprecatedFeatures") < 0) {
+ "./deprecatedFeatures") < 0 ||
+ virQEMUCapsParseHostCPUModelInfoDepFeats(ctxt, &hostCPU->static_dep_props,
+ "./hostDeprecatedFeatures") < 0) {
return -1;
}
@@ -5017,6 +5019,8 @@ virQEMUCapsFormatHostCPUModelInfo(virQEMUCapsAccel *caps,
virQEMUCapsFormatHostCPUModelInfoDepFeats(buf, model->full_dep_props,
"deprecatedFeatures");
+ virQEMUCapsFormatHostCPUModelInfoDepFeats(buf, model->static_dep_props,
+ "hostDeprecatedFeatures");
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</hostCPU>\n");
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index bcedd96f4e..504500c864 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -3375,6 +3375,7 @@ qemuMonitorCPUModelInfoFree(qemuMonitorCPUModelInfo *model_info)
}
g_strfreev(model_info->full_dep_props);
+ g_strfreev(model_info->static_dep_props);
g_free(model_info->props);
g_free(model_info->name);
g_free(model_info);
@@ -3420,6 +3421,7 @@ qemuMonitorCPUModelInfoCopy(const qemuMonitorCPUModelInfo *orig)
}
copy->full_dep_props = g_strdupv(orig->full_dep_props);
+ copy->static_dep_props = g_strdupv(orig->static_dep_props);
return copy;
}
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 6cd9329787..d096f474c1 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -1431,6 +1431,7 @@ struct _qemuMonitorCPUModelInfo {
size_t nprops;
qemuMonitorCPUProperty *props;
GStrv full_dep_props; /* deprecated properties resulting from a full model expansion */
+ GStrv static_dep_props; /* deprecated properties resulting from a static model expansion */
bool migratability;
};
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index e911c1929c..494d7ef515 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -5392,19 +5392,32 @@ static int
qemuMonitorJSONParseCPUModelExpansion(const char *cpu_name,
virJSONValue *cpu_props,
virJSONValue *cpu_deprecated_props,
+ qemuMonitorCPUModelExpansionType type,
qemuMonitorCPUModelInfo **model_info)
{
g_autoptr(qemuMonitorCPUModelInfo) expanded_model = NULL;
+ GStrv dep_props = NULL;
if (qemuMonitorJSONParseCPUModel(cpu_name, cpu_props, &expanded_model) < 0)
return -1;
if (cpu_deprecated_props &&
virJSONValueArraySize(cpu_deprecated_props) &&
- (!(expanded_model->full_dep_props = virJSONValueArrayToStringList(cpu_deprecated_props)))) {
+ (!(dep_props = virJSONValueArrayToStringList(cpu_deprecated_props)))) {
return -1;
}
+ switch (type) {
+ case QEMU_MONITOR_CPU_MODEL_EXPANSION_STATIC:
+ expanded_model->static_dep_props = dep_props;
+ break;
+
+ case QEMU_MONITOR_CPU_MODEL_EXPANSION_STATIC_FULL:
+ case QEMU_MONITOR_CPU_MODEL_EXPANSION_FULL:
+ expanded_model->full_dep_props = dep_props;
+ break;
+ }
+
*model_info = g_steal_pointer(&expanded_model);
return 0;
}
@@ -5509,7 +5522,7 @@ qemuMonitorJSONGetCPUModelExpansion(qemuMonitor *mon,
return qemuMonitorJSONParseCPUModelExpansion(cpu_name, cpu_props,
cpu_deprecated_props,
- model_info);
+ type, model_info);
}
diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml b/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml
index 0e834544af..82a66a6524 100644
--- a/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml
@@ -202,6 +202,12 @@
<property name='cte'/>
<property name='csske'/>
</deprecatedFeatures>
+ <hostDeprecatedFeatures>
+ <property name='bpb'/>
+ <property name='te'/>
+ <property name='cte'/>
+ <property name='csske'/>
+ </hostDeprecatedFeatures>
</hostCPU>
<cpu type='kvm' name='z13' typename='z13-s390x-cpu' usable='yes'/>
<cpu type='kvm' name='z990.3' typename='z990.3-s390x-cpu' usable='yes'/>
diff --git a/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml b/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml
index bdbb60a097..b961f79808 100644
--- a/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml
@@ -192,6 +192,12 @@
<property name='cte'/>
<property name='csske'/>
</deprecatedFeatures>
+ <hostDeprecatedFeatures>
+ <property name='bpb'/>
+ <property name='te'/>
+ <property name='cte'/>
+ <property name='csske'/>
+ </hostDeprecatedFeatures>
</hostCPU>
<cpu type='kvm' name='z13' typename='z13-s390x-cpu' usable='yes'/>
<cpu type='kvm' name='z990.3' typename='z990.3-s390x-cpu' usable='yes'/>
diff --git a/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml b/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml
index 8da55b1c4e..e9f79261f7 100644
--- a/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml
@@ -195,6 +195,12 @@
<property name='cte'/>
<property name='csske'/>
</deprecatedFeatures>
+ <hostDeprecatedFeatures>
+ <property name='bpb'/>
+ <property name='te'/>
+ <property name='cte'/>
+ <property name='csske'/>
+ </hostDeprecatedFeatures>
</hostCPU>
<cpu type='kvm' name='z13' typename='z13-s390x-cpu' usable='yes'/>
<cpu type='kvm' name='z990.3' typename='z990.3-s390x-cpu' usable='yes'/>
--
2.51.1
© 2016 - 2025 Red Hat, Inc.