qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v25 13/21] qapi/s390x/cpu topology: add query-s390x-cpu-polar


From: Markus Armbruster
Subject: Re: [PATCH v25 13/21] qapi/s390x/cpu topology: add query-s390x-cpu-polarization command
Date: Thu, 12 Oct 2023 13:41:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Nina Schoetterl-Glausch <nsg@linux.ibm.com> writes:

> From: Pierre Morel <pmorel@linux.ibm.com>
>
> The query-s390x-cpu-polarization qmp command returns the current
> CPU polarization of the machine.
>
> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
> Co-developed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
> Signed-off-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
> ---
>  qapi/machine-target.json | 30 ++++++++++++++++++++++++++++++
>  hw/s390x/cpu-topology.c  |  8 ++++++++
>  2 files changed, 38 insertions(+)
>
> diff --git a/qapi/machine-target.json b/qapi/machine-target.json
> index 02f1de5d02..10289835fb 100644
> --- a/qapi/machine-target.json
> +++ b/qapi/machine-target.json
> @@ -451,3 +451,33 @@
>    'features': [ 'unstable' ],
>    'if': { 'all': [ 'TARGET_S390X', 'CONFIG_KVM' ] }
>  }
> +
> +##
> +# @CpuPolarizationInfo:
> +#
> +# The result of a CPU polarization query.
> +#
> +# @polarization: the CPU polarization
> +#
> +# Since: 8.2
> +##
> +{ 'struct': 'CpuPolarizationInfo',
> +  'data': { 'polarization': 'CpuS390Polarization' },
> +  'if': { 'all': [ 'TARGET_S390X', 'CONFIG_KVM' ] }
> +}
> +
> +##
> +# @query-s390x-cpu-polarization:
> +#
> +# Features:
> +#
> +# @unstable: This command is experimental.
> +#
> +# Returns: the machine's CPU polarization
> +#
> +# Since: 8.2
> +##
> +{ 'command': 'query-s390x-cpu-polarization', 'returns': 
> 'CpuPolarizationInfo',
> +  'features': [ 'unstable' ],
> +  'if': { 'all': [ 'TARGET_S390X', 'CONFIG_KVM' ] }
> +}
> diff --git a/hw/s390x/cpu-topology.c b/hw/s390x/cpu-topology.c
> index 327bccea4f..f16bdf65fa 100644
> --- a/hw/s390x/cpu-topology.c
> +++ b/hw/s390x/cpu-topology.c
> @@ -459,3 +459,11 @@ void qmp_set_cpu_topology(uint16_t core,
>                           has_drawer, drawer, has_entitlement, entitlement,
>                           has_dedicated, dedicated, errp);
>  }
> +
> +CpuPolarizationInfo *qmp_query_s390x_cpu_polarization(Error **errp)
> +{
> +    CpuPolarizationInfo *info = g_new0(CpuPolarizationInfo, 1);
> +
> +    info->polarization = s390_topology.polarization;
> +    return info;
> +}

Acked-by: Markus Armbruster <armbru@redhat.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]