James Bottomley <james.bottom...@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.bottom...@hansenpartnership.com> > Tested-by: Stefan Berger <stef...@linux.ibm.com> > Reviewed-by: Stefan Berger <stef...@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: > # [...]