[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] qmp: Support fd-based KVM stats query
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH 1/2] qmp: Support fd-based KVM stats query |
Date: |
Wed, 20 Oct 2021 09:39:54 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 |
On 19/10/21 22:29, Mark Kanda wrote:
+#
+# @filter: KVM stat name (optional)
Nitpicking on the name, "filter" makes me think that some kind of
globbing is supported. So I would just call it "name".
Also nitpicking on the name, let's drop "kvm" from everything. In the
future other subsystems could expose statistics, both in the kernel and
in QEMU (e.g. vhost or TAP; even query-blockstats could be integrated).
Finally, I think we should decouple the description of the stats and the
description of the sources of said stats. For example:
name type
---- ----
vm kvm-vm
vcpu_0 kvm-vcpu
...
This way the caller knows that the "vcpu_*" stats follow the same
schema. That would be:
# e.g. name: 'vm', 'type: 'kvm-vm'
# or name: 'vcpu_0', 'type: 'kvm-vcpu'
{ 'struct': 'StatsInstance',
'data': {'name': 'str', 'type': 'str'}}
{ 'struct': 'StatsSchema',
'data': {'type': 'str', 'stats': [ 'KvmStatSchema' ] } }
{ 'struct': 'StatsValues',
'data': {'name': 'str', type': 'str', 'values': [ 'int64' ] } }
{ 'command': 'query-stats-instances',
'returns': [ 'StatsInstances' ] }
{ 'command': 'query-stats-schemas',
'data': { '*type': 'str' },
'returns': [ 'StatsSchema' ] }
{ 'command': 'query-stats',
'data': { '*name': 'str', '*type': 'str' },
'returns': [ 'StatsValues' ] }
This should be enough to make the API more future proof.
Paolo