* [Qemu-devel] [PATCH v2] tpm: Fix compilation with --disable-tpm
@ 2017-10-24 6:35 Juan Quintela
2017-10-24 9:47 ` Valluri, Amarnath
0 siblings, 1 reply; 3+ messages in thread
From: Juan Quintela @ 2017-10-24 6:35 UTC (permalink / raw)
To: qemu-devel; +Cc: dgilbert, lvivier, peterx, Amarnath Valluri
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;
}
diff --git a/vl.c b/vl.c
index 0723835bbf..dbfd06d4bc 100644
--- a/vl.c
+++ b/vl.c
@@ -4905,7 +4905,9 @@ int main(int argc, char **argv, char **envp)
res_free();
/* vhost-user must be cleaned up before chardevs. */
+#ifdef CONFIG_TPM
tpm_cleanup();
+#endif
net_cleanup();
audio_cleanup();
monitor_cleanup();
--
2.13.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v2] tpm: Fix compilation with --disable-tpm
2017-10-24 6:35 [Qemu-devel] [PATCH v2] tpm: Fix compilation with --disable-tpm Juan Quintela
@ 2017-10-24 9:47 ` Valluri, Amarnath
2017-10-24 12:18 ` Juan Quintela
0 siblings, 1 reply; 3+ messages in thread
From: Valluri, Amarnath @ 2017-10-24 9:47 UTC (permalink / raw)
To: qemu-devel, quintela; +Cc: dgilbert, peterx, lvivier
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v2] tpm: Fix compilation with --disable-tpm
2017-10-24 9:47 ` Valluri, Amarnath
@ 2017-10-24 12:18 ` Juan Quintela
0 siblings, 0 replies; 3+ messages in thread
From: Juan Quintela @ 2017-10-24 12:18 UTC (permalink / raw)
To: Valluri, Amarnath; +Cc: qemu-devel, dgilbert, peterx, lvivier
"Valluri, Amarnath" <amarnath.valluri@intel.com> wrote:
> 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.
Hi
We can't compile out tpm.c in case of disable CONFIG_TPM, but then it
makes no sense at all to have CONFIG_TPM on vl.c. We go for stubs or
CONFIG_TPM, both of them look bad, no?
Later, Juan.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-10-24 12:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-24 6:35 [Qemu-devel] [PATCH v2] tpm: Fix compilation with --disable-tpm Juan Quintela
2017-10-24 9:47 ` Valluri, Amarnath
2017-10-24 12:18 ` Juan Quintela
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.