* [Qemu-devel] [PATCH] tpm: add stubs for qdev-prop-tpm
@ 2017-12-18 12:16 Cornelia Huck
2017-12-18 12:27 ` Paolo Bonzini
0 siblings, 1 reply; 5+ messages in thread
From: Cornelia Huck @ 2017-12-18 12:16 UTC (permalink / raw)
To: stefanb, pbonzini; +Cc: marcandre.lureau, thuth, qemu-devel, 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")
Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
stubs/tpm.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/stubs/tpm.c b/stubs/tpm.c
index c18aac1c73..97457e0646 100644
--- a/stubs/tpm.c
+++ b/stubs/tpm.c
@@ -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.13.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] tpm: add stubs for qdev-prop-tpm
2017-12-18 12:16 [Qemu-devel] [PATCH] tpm: add stubs for qdev-prop-tpm Cornelia Huck
@ 2017-12-18 12:27 ` Paolo Bonzini
2017-12-18 12:35 ` Cornelia Huck
2017-12-18 15:58 ` Philippe Mathieu-Daudé
0 siblings, 2 replies; 5+ messages in thread
From: Paolo Bonzini @ 2017-12-18 12:27 UTC (permalink / raw)
To: Cornelia Huck, stefanb; +Cc: marcandre.lureau, thuth, qemu-devel
On 18/12/2017 13:16, Cornelia Huck wrote:
> 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")
> Reported-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
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
> ---
> stubs/tpm.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/stubs/tpm.c b/stubs/tpm.c
> index c18aac1c73..97457e0646 100644
> --- a/stubs/tpm.c
> +++ b/stubs/tpm.c
> @@ -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)
> +{
> +}
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] tpm: add stubs for qdev-prop-tpm
2017-12-18 12:27 ` Paolo Bonzini
@ 2017-12-18 12:35 ` Cornelia Huck
2017-12-18 12:37 ` Marc-André Lureau
2017-12-18 15:58 ` Philippe Mathieu-Daudé
1 sibling, 1 reply; 5+ messages in thread
From: Cornelia Huck @ 2017-12-18 12:35 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: stefanb, marcandre.lureau, thuth, qemu-devel
On Mon, 18 Dec 2017 13:27:09 +0100
Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 18/12/2017 13:16, Cornelia Huck wrote:
> > 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")
> > Reported-by: Thomas Huth <thuth@redhat.com>
> > Signed-off-by: Cornelia Huck <cohuck@redhat.com>
>
> 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?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] tpm: add stubs for qdev-prop-tpm
2017-12-18 12:35 ` Cornelia Huck
@ 2017-12-18 12:37 ` Marc-André Lureau
0 siblings, 0 replies; 5+ messages in thread
From: Marc-André Lureau @ 2017-12-18 12:37 UTC (permalink / raw)
To: Cornelia Huck; +Cc: Paolo Bonzini, Thomas Huth, QEMU, Stefan Berger
On Mon, Dec 18, 2017 at 1:35 PM, Cornelia Huck <cohuck@redhat.com> wrote:
> On Mon, 18 Dec 2017 13:27:09 +0100
> Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>> On 18/12/2017 13:16, Cornelia Huck wrote:
>> > 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")
>> > Reported-by: Thomas Huth <thuth@redhat.com>
>> > Signed-off-by: Cornelia Huck <cohuck@redhat.com>
>>
>> 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
--
Marc-André Lureau
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] tpm: add stubs for qdev-prop-tpm
2017-12-18 12:27 ` Paolo Bonzini
2017-12-18 12:35 ` Cornelia Huck
@ 2017-12-18 15:58 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-12-18 15:58 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Cornelia Huck, Stefan Berger, Marc-André Lureau,
Thomas Huth, qemu-devel@nongnu.org Developers
>> Add some proper stubs for those functions.
>>
>> Fixes: 493b78303532 ("qdev: add DEFINE_PROP_TPMBE")
>> Reported-by: Thomas Huth <thuth@redhat.com>
>> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
>
> 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 :)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-12-18 15:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-18 12:16 [Qemu-devel] [PATCH] tpm: add stubs for qdev-prop-tpm Cornelia Huck
2017-12-18 12:27 ` Paolo Bonzini
2017-12-18 12:35 ` Cornelia Huck
2017-12-18 12:37 ` Marc-André Lureau
2017-12-18 15:58 ` Philippe Mathieu-Daudé
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.