* [Qemu-devel] [PATCH] Fix compile with --disable-tpm
@ 2017-10-23 10:24 BALATON Zoltan
2017-10-23 11:09 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 4+ messages in thread
From: BALATON Zoltan @ 2017-10-23 10:24 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Berger, Paolo Bonzini
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
tpm.c | 7 ++++---
vl.c | 2 ++
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/tpm.c b/tpm.c
index 45520f5..b625cd4 100644
--- a/tpm.c
+++ b/tpm.c
@@ -30,8 +30,6 @@ void tpm_register_model(enum TpmModel model)
tpm_models[model] = true;
}
-#ifdef CONFIG_TPM
-
static const TPMBackendClass *
tpm_be_find_by_type(enum TpmType type)
{
@@ -48,6 +46,8 @@ tpm_be_find_by_type(enum TpmType type)
return TPM_BACKEND_CLASS(oc);
}
+#ifdef CONFIG_TPM
+
/*
* Walk the list of available TPM backend drivers and display them on the
* screen.
@@ -208,8 +208,9 @@ TPMInfoList *qmp_query_tpm(Error **errp)
continue;
}
info = g_new0(TPMInfoList, 1);
+#ifdef CONFIG_TPM
info->value = tpm_backend_query_tpm(drv);
-
+#endif
if (!cur_item) {
head = cur_item = info;
} else {
diff --git a/vl.c b/vl.c
index 0723835..dbfd06d 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.7.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix compile with --disable-tpm
2017-10-23 10:24 [Qemu-devel] [PATCH] Fix compile with --disable-tpm BALATON Zoltan
@ 2017-10-23 11:09 ` Philippe Mathieu-Daudé
2017-10-23 12:25 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-10-23 11:09 UTC (permalink / raw)
To: BALATON Zoltan, qemu-devel; +Cc: Paolo Bonzini, Stefan Berger
Hi Zoltan,
On 10/23/2017 07:24 AM, BALATON Zoltan wrote:
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
> ---
> tpm.c | 7 ++++---
> vl.c | 2 ++
> 2 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/tpm.c b/tpm.c
> index 45520f5..b625cd4 100644
> --- a/tpm.c
> +++ b/tpm.c
> @@ -30,8 +30,6 @@ void tpm_register_model(enum TpmModel model)
> tpm_models[model] = true;
> }
>
> -#ifdef CONFIG_TPM
> -
> static const TPMBackendClass *
> tpm_be_find_by_type(enum TpmType type)
> {
> @@ -48,6 +46,8 @@ tpm_be_find_by_type(enum TpmType type)
> return TPM_BACKEND_CLASS(oc);
> }
>
> +#ifdef CONFIG_TPM
> +
> /*
> * Walk the list of available TPM backend drivers and display them on the
> * screen.
> @@ -208,8 +208,9 @@ TPMInfoList *qmp_query_tpm(Error **errp)
> continue;
> }
> info = g_new0(TPMInfoList, 1);
> +#ifdef CONFIG_TPM
> info->value = tpm_backend_query_tpm(drv);
> -
> +#endif
> if (!cur_item) {
> head = cur_item = info;
> } else {
> diff --git a/vl.c b/vl.c
> index 0723835..dbfd06d 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();
Can you instead add tpm_cleanup() in stubs/tpm.c?
Regards,
Phil.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix compile with --disable-tpm
2017-10-23 11:09 ` Philippe Mathieu-Daudé
@ 2017-10-23 12:25 ` Philippe Mathieu-Daudé
2017-10-23 15:39 ` BALATON Zoltan
0 siblings, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-10-23 12:25 UTC (permalink / raw)
To: BALATON Zoltan, qemu-devel; +Cc: Paolo Bonzini, Stefan Berger
On 10/23/2017 08:09 AM, Philippe Mathieu-Daudé wrote:
> On 10/23/2017 07:24 AM, BALATON Zoltan wrote:
[...]
>> info = g_new0(TPMInfoList, 1);
>> +#ifdef CONFIG_TPM
>> info->value = tpm_backend_query_tpm(drv);
>> -
>> +#endif
>> if (!cur_item) {
>> head = cur_item = info;
>> } else {
>> diff --git a/vl.c b/vl.c
>> index 0723835..dbfd06d 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();
>
> Can you instead add tpm_cleanup() in stubs/tpm.c?
and tpm_backend_query_tpm() ;)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix compile with --disable-tpm
2017-10-23 12:25 ` Philippe Mathieu-Daudé
@ 2017-10-23 15:39 ` BALATON Zoltan
0 siblings, 0 replies; 4+ messages in thread
From: BALATON Zoltan @ 2017-10-23 15:39 UTC (permalink / raw)
To: Philippe Mathieu-Daudé; +Cc: qemu-devel, Paolo Bonzini, Stefan Berger
On Mon, 23 Oct 2017, Philippe Mathieu-Daudé wrote:
> On 10/23/2017 08:09 AM, Philippe Mathieu-Daudé wrote:
>> On 10/23/2017 07:24 AM, BALATON Zoltan wrote:
> [...]
>>> info = g_new0(TPMInfoList, 1);
>>> +#ifdef CONFIG_TPM
>>> info->value = tpm_backend_query_tpm(drv);
>>> -
>>> +#endif
>>> if (!cur_item) {
>>> head = cur_item = info;
>>> } else {
>>> diff --git a/vl.c b/vl.c
>>> index 0723835..dbfd06d 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();
>>
>> Can you instead add tpm_cleanup() in stubs/tpm.c?
>
> and tpm_backend_query_tpm() ;)
The v2 I've sent avoids #ifdefs outside tpm.c so isn't that acceptable? Do
we still need stubs for these? I don't understand how stubs are compiled
so if it's needed can you point me to an example what needs to be done to
add stubs for these? (I'm not familiar with this, just tried to fix a
compile problem I've met but I don't really know what's the correct way to
fix this. I'd expect the author of the patch that broke it to fix it
instead or at least review this to avoid breaking it more.)
Regards,
BALATON Zoltan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-23 15:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-23 10:24 [Qemu-devel] [PATCH] Fix compile with --disable-tpm BALATON Zoltan
2017-10-23 11:09 ` Philippe Mathieu-Daudé
2017-10-23 12:25 ` Philippe Mathieu-Daudé
2017-10-23 15:39 ` BALATON Zoltan
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).