Stefan Berger <stef...@linux.ibm.com> writes: > The following patches entirely elimiante TPM related code if CONFIG_TPM > is not set. > > Stefan
I believe this is on top of Philippe's "[PATCH v2 2/2] tpm: Return QMP error when TPM is disabled in build" Based-on: <20210609184955.1193081-3-phi...@redhat.com> However, it should probably go *first*, so the additional 'if' to suppress warnings about unused qmp_marshal_output_TpmFOO() can be squashed into Philippe's patch. Apart from that, this looks good to me! Additional 'if': diff --git a/qapi/tpm.json b/qapi/tpm.json index 09332e6f99..e74c881ea6 100644 --- a/qapi/tpm.json +++ b/qapi/tpm.json @@ -17,7 +17,9 @@ # # Since: 1.5 ## -{ 'enum': 'TpmModel', 'data': [ 'tpm-tis', 'tpm-crb', 'tpm-spapr' ] } +{ 'enum': 'TpmModel', 'data': [ 'tpm-tis', 'tpm-crb', 'tpm-spapr' ], + 'if': 'defined(CONFIG_TPM)' } + ## # @query-tpm-models: # @@ -47,7 +49,8 @@ # # Since: 1.5 ## -{ 'enum': 'TpmType', 'data': [ 'passthrough', 'emulator' ] } +{ 'enum': 'TpmType', 'data': [ 'passthrough', 'emulator' ], + 'if': 'defined(CONFIG_TPM)' } ## # @query-tpm-types: @@ -124,7 +127,8 @@ { 'struct': 'TPMInfo', 'data': {'id': 'str', 'model': 'TpmModel', - 'options': 'TpmTypeOptions' } } + 'options': 'TpmTypeOptions' }, + 'if': 'defined(CONFIG_TPM)' } ## # @query-tpm: