qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v10 1/2] tpm: convert tpmdev options processing to new visito


From: Markus Armbruster
Subject: Re: [PATCH v10 1/2] tpm: convert tpmdev options processing to new visitor format
Date: Thu, 02 May 2024 10:35:56 +0200
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 1577b5c259..5604553b7d 100644
> --- a/qapi/tpm.json
> +++ b/qapi/tpm.json
> @@ -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

9.1

> +##
> +{ '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: Iguess query-tpm has it one level up, in TPMInfo.

Okay.

>  ##
>  # @TPMInfo:
>  #

[...]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]