[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v11 1/2] tpm: convert tpmdev options processing to new visito
From: |
Markus Armbruster |
Subject: |
Re: [PATCH v11 1/2] tpm: convert tpmdev options processing to new visitor format |
Date: |
Tue, 07 Jan 2025 15:12:09 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
James Bottomley <James.Bottomley@HansenPartnership.com> writes:
> Instead of processing the tpmdev options using the old qemu options,
> convert to the new visitor format which also allows the passing of
> json on the command line.
>
> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
> Tested-by: Stefan Berger <stefanb@linux.ibm.com>
> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
[...]
> diff --git a/qapi/tpm.json b/qapi/tpm.json
> index a16a72edb9..e6345d424b 100644
> --- a/qapi/tpm.json
> +++ b/qapi/tpm.json
Looks like you missed my review of v10. I'll copy it below for your
convenience.
> @@ -142,6 +142,27 @@
> 'emulator': 'TPMEmulatorOptionsWrapper' },
> 'if': 'CONFIG_TPM' }
>
> +##
> +# @TpmCreateOptions:
> +#
> +# A union referencing different TPM backend types' configuration options
> +# without the wrapper to be usable by visitors.
reST trap: this is a definition list. Delete the second line's
indentation to make it a paragraph:
# A union referencing different TPM backend types' configuration
# options without the wrapper to be usable by visitors.
> +#
> +# @type: - 'passthrough' The configuration options for the TPM passthrough
> type
> +# - 'emulator' The configuration options for TPM emulator backend type
docs/devel/qapi-code-gen.rst:
Descriptions start with '\@name:'. The description text must be
indented like this::
# @name: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed
# do eiusmod tempor incididunt ut labore et dolore magna aliqua.
You indent more to make the '-' line up. Hmm.
Let's indent this like @TpmTypeOptions right above, namely
# @type:
# - 'passthrough' The configuration options for the TPM
# passthrough type
# - 'emulator' The configuration options for TPM emulator backend
# type
> +#
> +# @id: The Id of the TPM
What kind of Id is this?
> +#
> +# Since: 9.0
10.0
> +##
> +{ 'union': 'TpmCreateOptions',
> + 'base': { 'type': 'TpmType',
> + 'id' : 'str' },
> + 'discriminator': 'type',
> + 'data': { 'passthrough' : 'TPMPassthroughOptions',
> + 'emulator': 'TPMEmulatorOptions' },
> + 'if': 'CONFIG_TPM' }
This is a flattened version of TpmTypeOptions with additional member
@id.
Flattened: the union branches use Foo instead of FooWrapper.
@id: I guess query-tpm has it one level up, in TPMInfo.
Okay.
> +
> ##
> # @TPMInfo:
> #
[...]