Skip to contentSkip to conversation

tpm: add stubs for qdev-prop-tpm

PATCH In review Cornelia Huck 4 participants 5 messages Dec 18, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tpm: add stubs for qdev-prop-tpm

Building with --disable-tpm yields

../hw/core/qdev-properties-system.o: In function `set_tpm':
/home/cohuck/git/qemu/hw/core/qdev-properties-system.c:274: undefined reference to qemu_find_tpm_be' /home/cohuck/git/qemu/hw/core/qdev-properties-system.c:278: undefined reference to tpm_backend_init' ../hw/core/qdev-properties-system.o: In function `release_tpm':
/home/cohuck/git/qemu/hw/core/qdev-properties-system.c:291: undefined reference to `tpm_backend_reset'

Add some proper stubs for those functions.

Fixes 493b78303532 ("qdev: add DEFINE_PROP_TPMBE")
---
 stubs/tpm.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
stubs/tpm.c +15 -0
index c18aac1c73..97457e0646 100644
@@ -7,6 +7,7 @@
 #include "qemu/osdep.h"
 #include "sysemu/tpm.h"
 #include "qmp-commands.h"
+#include "sysemu/tpm_backend.h"
 
 int tpm_init(void)
 {
@@ -31,3 +32,17 @@ TpmModelList *qmp_query_tpm_models(Error **errp)
 {
     return NULL;
 }
+
+TPMBackend *qemu_find_tpm_be(const char *id)
+{
+    return NULL;
+}
+
+int tpm_backend_init(TPMBackend *s, TPMIf *tpmif, Error **errp)
+{
+    return -1;
+}
+
+void tpm_backend_reset(TPMBackend *s)
+{
+}
Signature · 1 line
2.13.6
#1 lore raw
Quoted 8 lines · Cornelia Huck

Building with --disable-tpm yields

../hw/core/qdev-properties-system.o: In function `set_tpm':
/home/cohuck/git/qemu/hw/core/qdev-properties-system.c:274: undefined reference to qemu_find_tpm_be' /home/cohuck/git/qemu/hw/core/qdev-properties-system.c:278: undefined reference to tpm_backend_init' ../hw/core/qdev-properties-system.o: In function `release_tpm':
/home/cohuck/git/qemu/hw/core/qdev-properties-system.c:291: undefined reference to `tpm_backend_reset'

Quoted 5 lines

Add some proper stubs for those functions.

Fixes 493b78303532 ("qdev: add DEFINE_PROP_TPMBE")

Maybe all the new code can be moved from qdev-properties-system.c to hw/tpm/qdev.c instead? (Adding stubs should be the last resort, especially if the stubs are never used outside system emulation).

Thanks,

Paolo

Quoted 35 lines
---
 stubs/tpm.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
stubs/tpm.c +15 -0
index c18aac1c73..97457e0646 100644
@@ -7,6 +7,7 @@
 #include "qemu/osdep.h"
 #include "sysemu/tpm.h"
 #include "qmp-commands.h"
+#include "sysemu/tpm_backend.h"
 
 int tpm_init(void)
 {
@@ -31,3 +32,17 @@ TpmModelList *qmp_query_tpm_models(Error **errp)
 {
     return NULL;
 }
+
+TPMBackend *qemu_find_tpm_be(const char *id)
+{
+    return NULL;
+}
+
+int tpm_backend_init(TPMBackend *s, TPMIf *tpmif, Error **errp)
+{
+    return -1;
+}
+
+void tpm_backend_reset(TPMBackend *s)
+{
+}
#2 lore raw
Quoted 11 lines · On Mon, 18 Dec 2017 13:27:09 +0100 Paolo Bonzini <[email protected]> wrote:
Quoted 10 lines · Cornelia Huck

Building with --disable-tpm yields

../hw/core/qdev-properties-system.o: In function `set_tpm':
/home/cohuck/git/qemu/hw/core/qdev-properties-system.c:274: undefined reference to qemu_find_tpm_be' /home/cohuck/git/qemu/hw/core/qdev-properties-system.c:278: undefined reference to tpm_backend_init' ../hw/core/qdev-properties-system.o: In function `release_tpm':
/home/cohuck/git/qemu/hw/core/qdev-properties-system.c:291: undefined reference to `tpm_backend_reset'

Add some proper stubs for those functions.

Quoted 7 lines
Quoted 3 lines
Fixes 493b78303532 ("qdev: add DEFINE_PROP_TPMBE")

Maybe all the new code can be moved from qdev-properties-system.c to hw/tpm/qdev.c instead? (Adding stubs should be the last resort, especially if the stubs are never used outside system emulation).

Probably hw/tpm/tpm-tis.c?

#3 lore raw
Quoted 18 lines · Cornelia Huck
Quoted 15 lines · On Mon, 18 Dec 2017 13:27:09 +0100 Paolo Bonzini <[email protected]> wrote:
Quoted 13 lines · Cornelia Huck

Building with --disable-tpm yields

../hw/core/qdev-properties-system.o: In function `set_tpm':
/home/cohuck/git/qemu/hw/core/qdev-properties-system.c:274: undefined reference to qemu_find_tpm_be' /home/cohuck/git/qemu/hw/core/qdev-properties-system.c:278: undefined reference to tpm_backend_init' ../hw/core/qdev-properties-system.o: In function `release_tpm':
/home/cohuck/git/qemu/hw/core/qdev-properties-system.c:291: undefined reference to `tpm_backend_reset'

Add some proper stubs for those functions.

Fixes 493b78303532 ("qdev: add DEFINE_PROP_TPMBE")
Quoted 5 lines
Quoted 3 lines

Maybe all the new code can be moved from qdev-properties-system.c to hw/tpm/qdev.c instead? (Adding stubs should be the last resort, especially if the stubs are never used outside system emulation).

Probably hw/tpm/tpm-tis.c?

Rather hw/tpm/tpm_util.c (the PROP is going to be shared by various devices soon)

thanks

Signature · 1 line
Marc-André Lureau
#4 lore raw
In reply to Paolo Bonzini
Quoted 9 lines
Quoted 5 lines

Add some proper stubs for those functions.

Fixes 493b78303532 ("qdev: add DEFINE_PROP_TPMBE")

Maybe all the new code can be moved from qdev-properties-system.c to hw/tpm/qdev.c instead? (Adding stubs should be the last resort, especially if the stubs are never used outside system emulation).

This is worth an entry in HACKING :)