aboutsummaryrefslogtreecommitdiff
path: root/qapi
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2022-06-16 07:13:04 -0700
committerRichard Henderson <richard.henderson@linaro.org>2022-06-16 07:13:04 -0700
commitdef6fd6c9ce9e00a30cdd0066e0fde206b3f3d2f (patch)
treedc547432f542e829ed0e770beca1dbb13e2223ef /qapi
parent9ac873a46963098441be920ef7a2eaf244a3352d (diff)
parent76ca98b0f85222601bd449252ac71df19e0dab29 (diff)
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
* statistics subsystem * virtio reset cleanups * build system cleanups * fix Cirrus CI # -----BEGIN PGP SIGNATURE----- # # iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmKpooQUHHBib256aW5p # QHJlZGhhdC5jb20ACgkQv/vSX3jHroNlFwf+OugLGRZl3KVc7akQwUJe9gg2T31h # VkC+7Tei8FAwe8vDppVd+CYEIi0M3acxD2amRrv2etCCGSuySN1PbkfRcSfPBX01 # pRWpasdhfqnZR8Iidi7YW1Ou5CcGqKH49nunBhW10+osb/mu5sVscMuOJgTDj/lK # CpsmDyk6572yGmczjNLlmhYcTU36clHpAZgazZHwk1PU+B3fCKlYYyvUpT3ItJvd # cK92aIUWrfofl3yTy0k4IwvZwNjTBirlstOIomZ333xzSA+mm5TR+mTvGRTZ69+a # v+snpMp4ILDMoB5kxQ42kK5WpdiN//LnriA9CBFDtOidsDDn8kx7gJe2RA== # =Dxwa # -----END PGP SIGNATURE----- # gpg: Signature made Wed 15 Jun 2022 02:12:36 AM PDT # gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83 # gpg: issuer "pbonzini@redhat.com" # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [undefined] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [undefined] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * tag 'for-upstream' of https://gitlab.com/bonzini/qemu: (21 commits) build: include pc-bios/ part in the ROMS variable meson: put cross compiler info in a separate section q35:Enable TSEG only when G_SMRAME and TSEG_EN both enabled build: fix check for -fsanitize-coverage-allowlist tests/vm: allow running tests in an unconfigured source tree configure: cleanup -fno-pie detection configure: update list of preserved environment variables virtio-mmio: cleanup reset virtio: stop ioeventfd on reset virtio-mmio: stop ioeventfd on legacy reset s390x: simplify virtio_ccw_reset_virtio block: add more commands to preconfig mode hmp: add filtering of statistics by name qmp: add filtering of statistics by name hmp: add filtering of statistics by provider qmp: add filtering of statistics by provider hmp: add basic "info stats" implementation cutils: add functions for IEC and SI prefixes qmp: add filtering of statistics by target vCPU kvm: Support for querying fd-based stats ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'qapi')
-rw-r--r--qapi/block-core.json117
-rw-r--r--qapi/block-export.json21
-rw-r--r--qapi/block.json6
-rw-r--r--qapi/meson.build1
-rw-r--r--qapi/qapi-schema.json1
-rw-r--r--qapi/stats.json249
6 files changed, 347 insertions, 48 deletions
diff --git a/qapi/block-core.json b/qapi/block-core.json
index f0383c7925..457df16638 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -737,7 +737,8 @@
# }
#
##
-{ 'command': 'query-block', 'returns': ['BlockInfo'] }
+{ 'command': 'query-block', 'returns': ['BlockInfo'],
+ 'allow-preconfig': true }
##
# @BlockDeviceTimedStats:
@@ -1113,7 +1114,8 @@
##
{ 'command': 'query-blockstats',
'data': { '*query-nodes': 'bool' },
- 'returns': ['BlockStats'] }
+ 'returns': ['BlockStats'],
+ 'allow-preconfig': true }
##
# @BlockdevOnError:
@@ -1262,7 +1264,8 @@
#
# Since: 1.1
##
-{ 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
+{ 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'],
+ 'allow-preconfig': true }
##
# @block_resize:
@@ -1293,7 +1296,8 @@
'data': { '*device': 'str',
'*node-name': 'str',
'size': 'int' },
- 'coroutine': true }
+ 'coroutine': true,
+ 'allow-preconfig': true }
##
# @NewImageMode:
@@ -1509,7 +1513,8 @@
#
##
{ 'command': 'blockdev-snapshot-sync',
- 'data': 'BlockdevSnapshotSync' }
+ 'data': 'BlockdevSnapshotSync',
+ 'allow-preconfig': true }
##
# @blockdev-snapshot:
@@ -1550,7 +1555,8 @@
##
{ 'command': 'blockdev-snapshot',
'data': 'BlockdevSnapshot',
- 'features': [ 'allow-write-only-overlay' ] }
+ 'features': [ 'allow-write-only-overlay' ],
+ 'allow-preconfig': true }
##
# @change-backing-file:
@@ -1582,7 +1588,8 @@
##
{ 'command': 'change-backing-file',
'data': { 'device': 'str', 'image-node-name': 'str',
- 'backing-file': 'str' } }
+ 'backing-file': 'str' },
+ 'allow-preconfig': true }
##
# @block-commit:
@@ -1692,7 +1699,8 @@
'*backing-file': 'str', '*speed': 'int',
'*on-error': 'BlockdevOnError',
'*filter-node-name': 'str',
- '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
+ '*auto-finalize': 'bool', '*auto-dismiss': 'bool' },
+ 'allow-preconfig': true }
##
# @drive-backup:
@@ -1721,7 +1729,8 @@
#
##
{ 'command': 'drive-backup', 'boxed': true,
- 'data': 'DriveBackup', 'features': ['deprecated'] }
+ 'data': 'DriveBackup', 'features': ['deprecated'],
+ 'allow-preconfig': true }
##
# @blockdev-backup:
@@ -1747,7 +1756,8 @@
#
##
{ 'command': 'blockdev-backup', 'boxed': true,
- 'data': 'BlockdevBackup' }
+ 'data': 'BlockdevBackup',
+ 'allow-preconfig': true }
##
# @query-named-block-nodes:
@@ -1813,7 +1823,8 @@
##
{ 'command': 'query-named-block-nodes',
'returns': [ 'BlockDeviceInfo' ],
- 'data': { '*flat': 'bool' } }
+ 'data': { '*flat': 'bool' },
+ 'allow-preconfig': true }
##
# @XDbgBlockGraphNodeType:
@@ -1922,7 +1933,8 @@
# Since: 4.0
##
{ 'command': 'x-debug-query-block-graph', 'returns': 'XDbgBlockGraph',
- 'features': [ 'unstable' ] }
+ 'features': [ 'unstable' ],
+ 'allow-preconfig': true }
##
# @drive-mirror:
@@ -1950,7 +1962,8 @@
#
##
{ 'command': 'drive-mirror', 'boxed': true,
- 'data': 'DriveMirror' }
+ 'data': 'DriveMirror',
+ 'allow-preconfig': true }
##
# @DriveMirror:
@@ -2123,7 +2136,8 @@
#
##
{ 'command': 'block-dirty-bitmap-add',
- 'data': 'BlockDirtyBitmapAdd' }
+ 'data': 'BlockDirtyBitmapAdd',
+ 'allow-preconfig': true }
##
# @block-dirty-bitmap-remove:
@@ -2147,7 +2161,8 @@
#
##
{ 'command': 'block-dirty-bitmap-remove',
- 'data': 'BlockDirtyBitmap' }
+ 'data': 'BlockDirtyBitmap',
+ 'allow-preconfig': true }
##
# @block-dirty-bitmap-clear:
@@ -2170,7 +2185,8 @@
#
##
{ 'command': 'block-dirty-bitmap-clear',
- 'data': 'BlockDirtyBitmap' }
+ 'data': 'BlockDirtyBitmap',
+ 'allow-preconfig': true }
##
# @block-dirty-bitmap-enable:
@@ -2191,7 +2207,8 @@
#
##
{ 'command': 'block-dirty-bitmap-enable',
- 'data': 'BlockDirtyBitmap' }
+ 'data': 'BlockDirtyBitmap',
+ 'allow-preconfig': true }
##
# @block-dirty-bitmap-disable:
@@ -2212,7 +2229,8 @@
#
##
{ 'command': 'block-dirty-bitmap-disable',
- 'data': 'BlockDirtyBitmap' }
+ 'data': 'BlockDirtyBitmap',
+ 'allow-preconfig': true }
##
# @block-dirty-bitmap-merge:
@@ -2244,7 +2262,8 @@
#
##
{ 'command': 'block-dirty-bitmap-merge',
- 'data': 'BlockDirtyBitmapMerge' }
+ 'data': 'BlockDirtyBitmapMerge',
+ 'allow-preconfig': true }
##
# @BlockDirtyBitmapSha256:
@@ -2275,7 +2294,8 @@
##
{ 'command': 'x-debug-block-dirty-bitmap-sha256',
'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256',
- 'features': [ 'unstable' ] }
+ 'features': [ 'unstable' ],
+ 'allow-preconfig': true }
##
# @blockdev-mirror:
@@ -2361,7 +2381,8 @@
'*on-target-error': 'BlockdevOnError',
'*filter-node-name': 'str',
'*copy-mode': 'MirrorCopyMode',
- '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
+ '*auto-finalize': 'bool', '*auto-dismiss': 'bool' },
+ 'allow-preconfig': true }
##
# @BlockIOThrottle:
@@ -2663,7 +2684,8 @@
'*base-node': 'str', '*backing-file': 'str', '*bottom': 'str',
'*speed': 'int', '*on-error': 'BlockdevOnError',
'*filter-node-name': 'str',
- '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
+ '*auto-finalize': 'bool', '*auto-dismiss': 'bool' },
+ 'allow-preconfig': true }
##
# @block-job-set-speed:
@@ -2687,7 +2709,8 @@
# Since: 1.1
##
{ 'command': 'block-job-set-speed',
- 'data': { 'device': 'str', 'speed': 'int' } }
+ 'data': { 'device': 'str', 'speed': 'int' },
+ 'allow-preconfig': true }
##
# @block-job-cancel:
@@ -2726,7 +2749,8 @@
#
# Since: 1.1
##
-{ 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
+{ 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' },
+ 'allow-preconfig': true }
##
# @block-job-pause:
@@ -2750,7 +2774,8 @@
#
# Since: 1.3
##
-{ 'command': 'block-job-pause', 'data': { 'device': 'str' } }
+{ 'command': 'block-job-pause', 'data': { 'device': 'str' },
+ 'allow-preconfig': true }
##
# @block-job-resume:
@@ -2772,7 +2797,8 @@
#
# Since: 1.3
##
-{ 'command': 'block-job-resume', 'data': { 'device': 'str' } }
+{ 'command': 'block-job-resume', 'data': { 'device': 'str' },
+ 'allow-preconfig': true }
##
# @block-job-complete:
@@ -2800,7 +2826,8 @@
#
# Since: 1.3
##
-{ 'command': 'block-job-complete', 'data': { 'device': 'str' } }
+{ 'command': 'block-job-complete', 'data': { 'device': 'str' },
+ 'allow-preconfig': true }
##
# @block-job-dismiss:
@@ -2820,7 +2847,8 @@
#
# Since: 2.12
##
-{ 'command': 'block-job-dismiss', 'data': { 'id': 'str' } }
+{ 'command': 'block-job-dismiss', 'data': { 'id': 'str' },
+ 'allow-preconfig': true }
##
# @block-job-finalize:
@@ -2838,7 +2866,8 @@
#
# Since: 2.12
##
-{ 'command': 'block-job-finalize', 'data': { 'id': 'str' } }
+{ 'command': 'block-job-finalize', 'data': { 'id': 'str' },
+ 'allow-preconfig': true }
##
# @BlockdevDiscardOptions:
@@ -4354,7 +4383,8 @@
# <- { "return": {} }
#
##
-{ 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
+{ 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true,
+ 'allow-preconfig': true }
##
# @blockdev-reopen:
@@ -4398,7 +4428,8 @@
# Since: 6.1
##
{ 'command': 'blockdev-reopen',
- 'data': { 'options': ['BlockdevOptions'] } }
+ 'data': { 'options': ['BlockdevOptions'] },
+ 'allow-preconfig': true }
##
# @blockdev-del:
@@ -4431,7 +4462,8 @@
# <- { "return": {} }
#
##
-{ 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
+{ 'command': 'blockdev-del', 'data': { 'node-name': 'str' },
+ 'allow-preconfig': true }
##
# @BlockdevCreateOptionsFile:
@@ -4872,7 +4904,8 @@
##
{ 'command': 'blockdev-create',
'data': { 'job-id': 'str',
- 'options': 'BlockdevCreateOptions' } }
+ 'options': 'BlockdevCreateOptions' },
+ 'allow-preconfig': true }
##
# @BlockdevAmendOptionsLUKS:
@@ -4944,7 +4977,8 @@
'node-name': 'str',
'options': 'BlockdevAmendOptions',
'*force': 'bool' },
- 'features': [ 'unstable' ] }
+ 'features': [ 'unstable' ],
+ 'allow-preconfig': true }
##
# @BlockErrorAction:
@@ -5294,7 +5328,8 @@
#
##
{ 'command': 'block-set-write-threshold',
- 'data': { 'node-name': 'str', 'write-threshold': 'uint64' } }
+ 'data': { 'node-name': 'str', 'write-threshold': 'uint64' },
+ 'allow-preconfig': true }
##
# @x-blockdev-change:
@@ -5355,7 +5390,8 @@
'data' : { 'parent': 'str',
'*child': 'str',
'*node': 'str' },
- 'features': [ 'unstable' ] }
+ 'features': [ 'unstable' ],
+ 'allow-preconfig': true }
##
# @x-blockdev-set-iothread:
@@ -5397,7 +5433,8 @@
'data' : { 'node-name': 'str',
'iothread': 'StrOrNull',
'*force': 'bool' },
- 'features': [ 'unstable' ] }
+ 'features': [ 'unstable' ],
+ 'allow-preconfig': true }
##
# @QuorumOpType:
@@ -5529,7 +5566,8 @@
#
##
{ 'command': 'blockdev-snapshot-internal-sync',
- 'data': 'BlockdevSnapshotInternal' }
+ 'data': 'BlockdevSnapshotInternal',
+ 'allow-preconfig': true }
##
# @blockdev-snapshot-delete-internal-sync:
@@ -5576,4 +5614,5 @@
##
{ 'command': 'blockdev-snapshot-delete-internal-sync',
'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
- 'returns': 'SnapshotInfo' }
+ 'returns': 'SnapshotInfo',
+ 'allow-preconfig': true }
diff --git a/qapi/block-export.json b/qapi/block-export.json
index 0685cb8b9a..8afb1b65b3 100644
--- a/qapi/block-export.json
+++ b/qapi/block-export.json
@@ -65,7 +65,8 @@
'data': { 'addr': 'SocketAddressLegacy',
'*tls-creds': 'str',
'*tls-authz': 'str',
- '*max-connections': 'uint32' } }
+ '*max-connections': 'uint32' },
+ 'allow-preconfig': true }
##
# @BlockExportOptionsNbdBase:
@@ -215,7 +216,8 @@
# Since: 1.3
##
{ 'command': 'nbd-server-add',
- 'data': 'NbdServerAddOptions', 'boxed': true, 'features': ['deprecated'] }
+ 'data': 'NbdServerAddOptions', 'boxed': true, 'features': ['deprecated'],
+ 'allow-preconfig': true }
##
# @BlockExportRemoveMode:
@@ -260,7 +262,8 @@
##
{ 'command': 'nbd-server-remove',
'data': {'name': 'str', '*mode': 'BlockExportRemoveMode'},
- 'features': ['deprecated'] }
+ 'features': ['deprecated'],
+ 'allow-preconfig': true }
##
# @nbd-server-stop:
@@ -270,7 +273,8 @@
#
# Since: 1.3
##
-{ 'command': 'nbd-server-stop' }
+{ 'command': 'nbd-server-stop',
+ 'allow-preconfig': true }
##
# @BlockExportType:
@@ -342,7 +346,8 @@
# Since: 5.2
##
{ 'command': 'block-export-add',
- 'data': 'BlockExportOptions', 'boxed': true }
+ 'data': 'BlockExportOptions', 'boxed': true,
+ 'allow-preconfig': true }
##
# @block-export-del:
@@ -362,7 +367,8 @@
# Since: 5.2
##
{ 'command': 'block-export-del',
- 'data': { 'id': 'str', '*mode': 'BlockExportRemoveMode' } }
+ 'data': { 'id': 'str', '*mode': 'BlockExportRemoveMode' },
+ 'allow-preconfig': true }
##
# @BLOCK_EXPORT_DELETED:
@@ -406,4 +412,5 @@
#
# Since: 5.2
##
-{ 'command': 'query-block-exports', 'returns': ['BlockExportInfo'] }
+{ 'command': 'query-block-exports', 'returns': ['BlockExportInfo'],
+ 'allow-preconfig': true }
diff --git a/qapi/block.json b/qapi/block.json
index 19326641ac..5fe068f903 100644
--- a/qapi/block.json
+++ b/qapi/block.json
@@ -496,7 +496,8 @@
# <- { "return": {} }
##
{ 'command': 'block_set_io_throttle', 'boxed': true,
- 'data': 'BlockIOThrottle' }
+ 'data': 'BlockIOThrottle',
+ 'allow-preconfig': true }
##
# @block-latency-histogram-set:
@@ -572,4 +573,5 @@
'*boundaries': ['uint64'],
'*boundaries-read': ['uint64'],
'*boundaries-write': ['uint64'],
- '*boundaries-flush': ['uint64'] } }
+ '*boundaries-flush': ['uint64'] },
+ 'allow-preconfig': true }
diff --git a/qapi/meson.build b/qapi/meson.build
index 656ef0e039..fd5c93d643 100644
--- a/qapi/meson.build
+++ b/qapi/meson.build
@@ -46,6 +46,7 @@ qapi_all_modules = [
'replay',
'run-state',
'sockets',
+ 'stats',
'trace',
'transaction',
'yank',
diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json
index 4912b9744e..92d7ecc52c 100644
--- a/qapi/qapi-schema.json
+++ b/qapi/qapi-schema.json
@@ -93,3 +93,4 @@
{ 'include': 'audio.json' }
{ 'include': 'acpi.json' }
{ 'include': 'pci.json' }
+{ 'include': 'stats.json' }
diff --git a/qapi/stats.json b/qapi/stats.json
new file mode 100644
index 0000000000..2f8bfe8fdb
--- /dev/null
+++ b/qapi/stats.json
@@ -0,0 +1,249 @@
+# -*- Mode: Python -*-
+# vim: filetype=python
+#
+# Copyright (c) 2022 Oracle and/or its affiliates.
+#
+# This work is licensed under the terms of the GNU GPL, version 2 or later.
+# See the COPYING file in the top-level directory.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+##
+# = Statistics
+##
+
+##
+# @StatsType:
+#
+# Enumeration of statistics types
+#
+# @cumulative: stat is cumulative; value can only increase.
+# @instant: stat is instantaneous; value can increase or decrease.
+# @peak: stat is the peak value; value can only increase.
+# @linear-histogram: stat is a linear histogram.
+# @log2-histogram: stat is a logarithmic histogram, with one bucket
+# for each power of two.
+#
+# Since: 7.1
+##
+{ 'enum' : 'StatsType',
+ 'data' : [ 'cumulative', 'instant', 'peak', 'linear-histogram',
+ 'log2-histogram' ] }
+
+##
+# @StatsUnit:
+#
+# Enumeration of unit of measurement for statistics
+#
+# @bytes: stat reported in bytes.
+# @seconds: stat reported in seconds.
+# @cycles: stat reported in clock cycles.
+#
+# Since: 7.1
+##
+{ 'enum' : 'StatsUnit',
+ 'data' : [ 'bytes', 'seconds', 'cycles' ] }
+
+##
+# @StatsProvider:
+#
+# Enumeration of statistics providers.
+#
+# Since: 7.1
+##
+{ 'enum': 'StatsProvider',
+ 'data': [ 'kvm' ] }
+
+##
+# @StatsTarget:
+#
+# The kinds of objects on which one can request statistics.
+#
+# @vm: statistics that apply to the entire virtual machine or
+# the entire QEMU process.
+#
+# @vcpu: statistics that apply to a single virtual CPU.
+#
+# Since: 7.1
+##
+{ 'enum': 'StatsTarget',
+ 'data': [ 'vm', 'vcpu' ] }
+
+##
+# @StatsRequest:
+#
+# Indicates a set of statistics that should be returned by query-stats.
+#
+# @provider: provider for which to return statistics.
+
+# @names: statistics to be returned (all if omitted).
+#
+# Since: 7.1
+##
+{ 'struct': 'StatsRequest',
+ 'data': { 'provider': 'StatsProvider',
+ '*names': [ 'str' ] } }
+
+##
+# @StatsVCPUFilter:
+#
+# @vcpus: list of QOM paths for the desired vCPU objects.
+#
+# Since: 7.1
+##
+{ 'struct': 'StatsVCPUFilter',
+ 'data': { '*vcpus': [ 'str' ] } }
+
+##
+# @StatsFilter:
+#
+# The arguments to the query-stats command; specifies a target for which to
+# request statistics and optionally the required subset of information for
+# that target:
+# - which vCPUs to request statistics for
+# - which providers to request statistics from
+# - which named values to return within each provider
+#
+# Since: 7.1
+##
+{ 'union': 'StatsFilter',
+ 'base': {
+ 'target': 'StatsTarget',
+ '*providers': [ 'StatsRequest' ] },
+ 'discriminator': 'target',
+ 'data': { 'vcpu': 'StatsVCPUFilter' } }
+
+##
+# @StatsValue:
+#
+# @scalar: single unsigned 64-bit integers.
+# @list: list of unsigned 64-bit integers (used for histograms).
+#
+# Since: 7.1
+##
+{ 'alternate': 'StatsValue',
+ 'data': { 'scalar': 'uint64',
+ 'list': [ 'uint64' ] } }
+
+##
+# @Stats:
+#
+# @name: name of stat.
+# @value: stat value.
+#
+# Since: 7.1
+##
+{ 'struct': 'Stats',
+ 'data': { 'name': 'str',
+ 'value' : 'StatsValue' } }
+
+##
+# @StatsResult:
+#
+# @provider: provider for this set of statistics.
+#
+# @qom-path: Path to the object for which the statistics are returned,
+# if the object is exposed in the QOM tree
+#
+# @stats: list of statistics.
+#
+# Since: 7.1
+##
+{ 'struct': 'StatsResult',
+ 'data': { 'provider': 'StatsProvider',
+ '*qom-path': 'str',
+ 'stats': [ 'Stats' ] } }
+
+##
+# @query-stats:
+#
+# Return runtime-collected statistics for objects such as the
+# VM or its vCPUs.
+#
+# The arguments are a StatsFilter and specify the provider and objects
+# to return statistics about.
+#
+# Returns: a list of StatsResult, one for each provider and object
+# (e.g., for each vCPU).
+#
+# Since: 7.1
+##
+{ 'command': 'query-stats',
+ 'data': 'StatsFilter',
+ 'boxed': true,
+ 'returns': [ 'StatsResult' ] }
+
+##
+# @StatsSchemaValue:
+#
+# Schema for a single statistic.
+#
+# @name: name of the statistic; each element of the schema is uniquely
+# identified by a target, a provider (both available in @StatsSchema)
+# and the name.
+#
+# @type: kind of statistic.
+#
+# @unit: basic unit of measure for the statistic; if missing, the statistic
+# is a simple number or counter.
+#
+# @base: base for the multiple of @unit in which the statistic is measured.
+# Only present if @exponent is non-zero; @base and @exponent together
+# form a SI prefix (e.g., _nano-_ for ``base=10`` and ``exponent=-9``)
+# or IEC binary prefix (e.g. _kibi-_ for ``base=2`` and ``exponent=10``)
+#
+# @exponent: exponent for the multiple of @unit in which the statistic is
+# expressed, or 0 for the basic unit
+#
+# @bucket-size: Present when @type is "linear-histogram", contains the width
+# of each bucket of the histogram.
+#
+# Since: 7.1
+##
+{ 'struct': 'StatsSchemaValue',
+ 'data': { 'name': 'str',
+ 'type': 'StatsType',
+ '*unit': 'StatsUnit',
+ '*base': 'int8',
+ 'exponent': 'int16',
+ '*bucket-size': 'uint32' } }
+
+##
+# @StatsSchema:
+#
+# Schema for all available statistics for a provider and target.
+#
+# @provider: provider for this set of statistics.
+#
+# @target: the kind of object that can be queried through the provider.
+#
+# @stats: list of statistics.
+#
+# Since: 7.1
+##
+{ 'struct': 'StatsSchema',
+ 'data': { 'provider': 'StatsProvider',
+ 'target': 'StatsTarget',
+ 'stats': [ 'StatsSchemaValue' ] } }
+
+##
+# @query-stats-schemas:
+#
+# Return the schema for all available runtime-collected statistics.
+#
+# Note: runtime-collected statistics and their names fall outside QEMU's usual
+# deprecation policies. QEMU will try to keep the set of available data
+# stable, together with their names, but will not guarantee stability
+# at all costs; the same is true of providers that source statistics
+# externally, e.g. from Linux. For example, if the same value is being
+# tracked with different names on different architectures or by different
+# providers, one of them might be renamed. A statistic might go away if
+# an algorithm is changed or some code is removed; changing a default
+# might cause previously useful statistics to always report 0. Such
+# changes, however, are expected to be rare.
+#
+# Since: 7.1
+##
+{ 'command': 'query-stats-schemas',
+ 'data': { '*provider': 'StatsProvider' },
+ 'returns': [ 'StatsSchema' ] }