[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/8] qmp: add filtering of statistics by target vCPU
From: |
Markus Armbruster |
Subject: |
Re: [PATCH 3/8] qmp: add filtering of statistics by target vCPU |
Date: |
Thu, 05 May 2022 15:45:48 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Paolo Bonzini <pbonzini@redhat.com> writes:
> Introduce a simple filtering of statistics, that allows to retrieve
> statistics for a subset of the guest vCPUs. This will be used for
> example by the HMP monitor, in order to retrieve the statistics
> for the currently selected CPU.
>
> Example:
> { "execute": "query-stats",
> "arguments": {
> "target": "vcpu",
> "vcpus": [ "/machine/unattached/device[2]",
> "/machine/unattached/device[4]" ] } }
What heartless people put these poor vCPUs in the orphanage?
>
> Extracted from a patch by Mark Kanda.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[...]
> diff --git a/qapi/stats.json b/qapi/stats.json
> index bcc897258a..26ee69588f 100644
> --- a/qapi/stats.json
> +++ b/qapi/stats.json
> @@ -65,6 +65,16 @@
> { 'enum': 'StatsTarget',
> 'data': [ 'vm', 'vcpu' ] }
>
> +##
> +# @StatsVCPUFilter:
> +#
> +# @vcpus: list of qom paths for the desired vCPU objects.
"QOM paths", because that's how we spell it elsewhere.
> +#
> +# Since: 7.1
> +##
> +{ 'struct': 'StatsVCPUFilter',
> + 'data': { '*vcpus': [ 'str' ] } }
> +
> ##
> # @StatsFilter:
> #
> @@ -73,8 +83,10 @@
> #
> # Since: 7.1
> ##
> -{ 'struct': 'StatsFilter',
> - 'data': { 'target': 'StatsTarget' } }
> +{ 'union': 'StatsFilter',
> + 'base': { 'target': 'StatsTarget' },
> + 'discriminator': 'target',
> + 'data': { 'vcpu': 'StatsVCPUFilter' } }
>
> ##
> # @StatsValue:
- Re: [PATCH 3/8] qmp: add filtering of statistics by target vCPU,
Markus Armbruster <=