[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] qmp: Add query-qemu-features
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] qmp: Add query-qemu-features |
Date: |
Fri, 29 Mar 2019 17:06:27 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Kevin Wolf <address@hidden> writes:
> From: Stefan Hajnoczi <address@hidden>
>
> QMP clients can usually detect the presence of features via schema
> introspection. There are rare features that do not involve schema
> changes and are therefore impossible to detect with schema
> introspection.
>
> This patch adds the query-qemu-features command. It returns a struct
> containing booleans for each feature that QEMU can support.
>
> The decision to make this a command rather than something statically
> defined in the schema is intentional. It allows QEMU to decide which
> features are available at runtime, if necessary.
>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> qapi/misc.json | 23 +++++++++++++++++++++++
> qmp.c | 10 ++++++++++
> 2 files changed, 33 insertions(+)
>
> diff --git a/qapi/misc.json b/qapi/misc.json
> index 8b3ca4fdd3..d892f37633 100644
> --- a/qapi/misc.json
> +++ b/qapi/misc.json
> @@ -3051,3 +3051,26 @@
> 'data': 'NumaOptions',
> 'allow-preconfig': true
> }
> +
> +##
> +# @QemuFeatures:
> +#
> +# Information about support for QEMU features that isn't available through
> +# schema introspection.
This becomes incorrect the moment you apply the patch :)
> +#
> +# Since: 4.0
> +##
> +{ 'struct': 'QemuFeatures',
> + 'data': { } }
> +
> +##
> +# @query-qemu-features:
> +#
> +# Return the features supported by this QEMU. Most features can be detected
> +# via schema introspection but some are not observable from the schema. This
> +# command offers a way to check for the presence of such features.
Likewise.
To be useful, the command must document each feature's extent.
The feature added in the next patch is a property of the QEMU build.
This means:
* Running the command provides no additional information over
query-qmp-schema.
* You can safely cache the result for future invocations of the same
QEMU build.
We'll figure out implications of different feature extents once we have
them.
> +#
> +# Since: 4.0
> +##
> +{ 'command': 'query-qemu-features',
> + 'returns': 'QemuFeatures' }
> diff --git a/qmp.c b/qmp.c
> index b92d62cd5f..0aad533eca 100644
> --- a/qmp.c
> +++ b/qmp.c
> @@ -717,3 +717,13 @@ MemoryInfo *qmp_query_memory_size_summary(Error **errp)
>
> return mem_info;
> }
> +
> +QemuFeatures *qmp_query_qemu_features(Error **errp)
> +{
> + QemuFeatures *caps = g_new(QemuFeatures, 1);
> +
> + *caps = (QemuFeatures) {
> + };
> +
> + return caps;
> +}
- [Qemu-block] [PATCH 1/2] qmp: Add query-qemu-features, (continued)
- [Qemu-block] [PATCH 1/2] qmp: Add query-qemu-features, Kevin Wolf, 2019/03/28
- Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] qmp: Add query-qemu-features, Eric Blake, 2019/03/28
- Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] qmp: Add query-qemu-features, Markus Armbruster, 2019/03/29
- Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] qmp: Add query-qemu-features, Eric Blake, 2019/03/29
- Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] qmp: Add query-qemu-features, Markus Armbruster, 2019/03/29
- Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] qmp: Add query-qemu-features, Kevin Wolf, 2019/03/29
- Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] qmp: Add query-qemu-features, Kevin Wolf, 2019/03/29
- Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] qmp: Add query-qemu-features, Markus Armbruster, 2019/03/30
- [Qemu-block] Options for 4.0 (was: [Qemu-devel] [PATCH 1/2] qmp: Add query-qemu-features), Markus Armbruster, 2019/03/31
- Re: [Qemu-block] [Qemu-devel] Options for 4.0 (was: [PATCH 1/2] qmp: Add query-qemu-features), no-reply, 2019/03/31
Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] qmp: Add query-qemu-features,
Markus Armbruster <=
[Qemu-block] [PATCH 2/2] Add file-posix-dynamic-auto-read-only feature, Kevin Wolf, 2019/03/28
Re: [Qemu-block] [Qemu-devel] [PATCH 2/2] Add file-posix-dynamic-auto-read-only feature, Markus Armbruster, 2019/03/29
Re: [Qemu-block] [Qemu-devel] [PATCH 2/2] Add file-posix-dynamic-auto-read-only feature, Markus Armbruster, 2019/03/29