From: "Valluri, Amarnath" <amarnath.valluri@intel.com>
To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"quintela@redhat.com" <quintela@redhat.com>
Cc: "dgilbert@redhat.com" <dgilbert@redhat.com>,
"peterx@redhat.com" <peterx@redhat.com>,
"lvivier@redhat.com" <lvivier@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] tpm: Fix compilation with --disable-tpm
Date: Tue, 24 Oct 2017 09:47:46 +0000 [thread overview]
Message-ID: <1508838503.3135.12.camel@intel.com> (raw)
In-Reply-To: <20171024063550.22441-1-quintela@redhat.com>
On Tue, 2017-10-24 at 08:35 +0200, Juan Quintela wrote:
> Commit
> c37cacabf2285b0731b44c1f667781fdd4f2b658
>
> broke compilation without tpm. Just add an #ifdef
>
> CC: Amarnath Valluri <amarnath.valluri@intel.com>
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
> tpm.c | 6 +++++-
> vl.c | 2 ++
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/tpm.c b/tpm.c
> index 45520f555d..e2f3be2e08 100644
> --- a/tpm.c
> +++ b/tpm.c
> @@ -223,8 +223,11 @@ TPMInfoList *qmp_query_tpm(Error **errp)
>
> TpmTypeList *qmp_query_tpm_types(Error **errp)
> {
> + TpmTypeList *head = NULL;
> +
> +#ifdef CONFIG_TPM
> unsigned int i = 0;
> - TpmTypeList *head = NULL, *prev = NULL, *cur_item;
> + TpmTypeList *prev = NULL, *cur_item;
>
> for (i = 0; i < TPM_TYPE__MAX; i++) {
> if (!tpm_be_find_by_type(i)) {
> @@ -241,6 +244,7 @@ TpmTypeList *qmp_query_tpm_types(Error **errp)
> }
> prev = cur_item;
> }
> +#endif
>
> return head;
> }
I would prefer to bring everything in tpm.c under #ifdef CONFIG_TPM.
and provide dummy implementations only for qmp commands:
qmp_query_{tpm,_models,_types} in disable-tpm case.
- Amarnath
next prev parent reply other threads:[~2017-10-24 9:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-24 6:35 [Qemu-devel] [PATCH v2] tpm: Fix compilation with --disable-tpm Juan Quintela
2017-10-24 9:47 ` Valluri, Amarnath [this message]
2017-10-24 12:18 ` Juan Quintela
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1508838503.3135.12.camel@intel.com \
--to=amarnath.valluri@intel.com \
--cc=dgilbert@redhat.com \
--cc=lvivier@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).