On 7/5/23 09:58, Thomas Huth wrote:
On 30/06/2023 11.17, Pierre Morel wrote:
The query-cpu-polarization qmp command returns the current
CPU polarization of the machine.
Signed-off-by: Pierre Morel <pmorel@xxxxxxxxxxxxx>
---
qapi/machine-target.json | 29 +++++++++++++++++++++++++++++
hw/s390x/cpu-topology.c | 8 ++++++++
2 files changed, 37 insertions(+)
diff --git a/qapi/machine-target.json b/qapi/machine-target.json
index 1362e43983..1e4b8976aa 100644
--- a/qapi/machine-target.json
+++ b/qapi/machine-target.json
@@ -445,3 +445,32 @@
'features': [ 'unstable' ],
'if': { 'all': [ 'TARGET_S390X', 'CONFIG_KVM' ] }
}
+
+##
+# @CpuPolarizationInfo:
+#
+# The result of a cpu polarization
+#
+# @polarization: the CPU polarization
+#
+# Since: 8.1
+##
+{ 'struct': 'CpuPolarizationInfo',
+ 'data': { 'polarization': 'CpuS390Polarization' },
+ 'if': { 'all': [ 'TARGET_S390X', 'CONFIG_KVM' ] }
+}
+
+##
+# @query-cpu-polarization:
+#
+# Features:
+# @unstable: This command may still be modified.
+#
+# Returns: the machine polarization
+#
+# Since: 8.1
+##
+{ 'command': 'query-cpu-polarization', 'returns':
'CpuPolarizationInfo',
Since this is very specific to s390x, I wonder whether we want to have
a "s390x" in the command name? 'query-s390x-cpu-polarization'? ... or
is this getting too long already?
Anyway,
Reviewed-by: Thomas Huth <thuth@xxxxxxxxxx>
I do not know.I prefer short commands but the interface will mostly be
used by a program, so...
I let it like that unless there is more pressure to change it.
Thanks,
Pierre