diff mbox series

tpm: Don't call tpm_cleanup unless CONFIG_TPM.

Message ID 20171019075031.25507-1-rjones@redhat.com
State New
Headers show
Series tpm: Don't call tpm_cleanup unless CONFIG_TPM. | expand

Commit Message

Richard W.M. Jones Oct. 19, 2017, 7:50 a.m. UTC
When compiling with --disable-tpm:

  ../vl.o: In function `main':
  /home/rjones/d/qemu/vl.c:4908: undefined reference to `tpm_cleanup'

This appears to have been introduced in commit c37cacabf228
("tpm: Move tpm_cleanup() to right place").

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
---
 vl.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Stefan Berger Oct. 19, 2017, 2:06 p.m. UTC | #1
On 10/19/2017 03:50 AM, Richard W.M. Jones wrote:
> When compiling with --disable-tpm:
>
>    ../vl.o: In function `main':
>    /home/rjones/d/qemu/vl.c:4908: undefined reference to `tpm_cleanup'
>
> This appears to have been introduced in commit c37cacabf228
> ("tpm: Move tpm_cleanup() to right place").
>
> Signed-off-by: Richard W.M. Jones <rjones@redhat.com>

Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>


> ---
>   vl.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> 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();
Richard W.M. Jones Oct. 23, 2017, 9:03 p.m. UTC | #2
Since I posted this, there are more failures with --disable-tpm ...

  LINK    x86_64-softmmu/qemu-system-x86_64
../vl.o: In function `main':
/home/rjones/d/qemu/vl.c:4908: undefined reference to `tpm_cleanup'
../tpm.o: In function `qmp_query_tpm_types':
/home/rjones/d/qemu/tpm.c:230: undefined reference to `tpm_be_find_by_type'
../tpm.o: In function `qmp_query_tpm_types':
tpm.c:(.text+0x4a): undefined reference to `tpm_be_find_by_type'
tpm.c:(.text+0x7a): undefined reference to `tpm_be_find_by_type'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:193: qemu-system-x86_64] Error 1

Rich.
Michael Tokarev Nov. 6, 2017, 5:49 p.m. UTC | #3
19.10.2017 10:50, Richard W.M. Jones wrote:
> When compiling with --disable-tpm:
> 
>   ../vl.o: In function `main':
>   /home/rjones/d/qemu/vl.c:4908: undefined reference to `tpm_cleanup'
> 
> This appears to have been introduced in commit c37cacabf228
> ("tpm: Move tpm_cleanup() to right place").
> 

> 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

Maybe we can define it to an empty macro (or inline function) in
the header file instead?

/mjt
Stefan Berger Nov. 6, 2017, 5:52 p.m. UTC | #4
On 11/06/2017 12:49 PM, Michael Tokarev wrote:
> 19.10.2017 10:50, Richard W.M. Jones wrote:
>> When compiling with --disable-tpm:
>>
>>    ../vl.o: In function `main':
>>    /home/rjones/d/qemu/vl.c:4908: undefined reference to `tpm_cleanup'
>>
>> This appears to have been introduced in commit c37cacabf228
>> ("tpm: Move tpm_cleanup() to right place").
>>
>> 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
> Maybe we can define it to an empty macro (or inline function) in
> the header file instead?

It's solved with a stub in stubs/tpm.c.

   Stefan


>
> /mjt
>
diff mbox series

Patch

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();