Skip to contentSkip to conversation

tpm: Don't call tpm_cleanup unless CONFIG_TPM.

PATCH In review Richard W.M. Jones 3 participants 5 messages Oct 19, 2017 – Nov 6, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tpm: Don't call tpm_cleanup unless CONFIG_TPM.

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").

---
 vl.c | 2 ++
 1 file changed, 2 insertions(+)
vl.c +2 -0
index 0723835bbf..dbfd06d4bc 100644
@@ -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();
Signature · 1 line
2.13.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Richard W.M. Jones

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").

Quoted 18 lines
---
  vl.c | 2 ++
  1 file changed, 2 insertions(+)
vl.c +2 -0
index 0723835bbf..dbfd06d4bc 100644
@@ -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 lore raw
In reply to Richard W.M. Jones

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.

Signature · 5 lines
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v
#3 lore raw
In reply to Richard W.M. Jones
Quoted 13 lines · Richard W.M. Jones

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

vl.c int main(int argc, char **argv, char **envp) · line 4910

Quoted 6 lines
vl.c +2 -0
@@ -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

#4 lore raw
Quoted 15 lines · Michael Tokarev
Quoted 14 lines · Richard W.M. Jones

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

vl.c +0 -0
@@ -4905,7 +4905,9 @@ int main(int argc, char **argv, char **envp)
      res_free();
 
Quoted 6 lines

vl.c int main(int argc, char **argv, char **envp) · line 4910

Quoted 4 lines
vl.c +2 -0
      /* 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

Quoted 3 lines

/mjt