All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Cornelia Huck <cohuck@redhat.com>, stefanb@linux.vnet.ibm.com
Cc: marcandre.lureau@redhat.com, thuth@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] tpm: add stubs for qdev-prop-tpm
Date: Mon, 18 Dec 2017 13:27:09 +0100	[thread overview]
Message-ID: <deba612d-e6f0-7181-6328-7eec81f68034@redhat.com> (raw)
In-Reply-To: <20171218121635.25494-1-cohuck@redhat.com>

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)
> +{
> +}
> 

  reply	other threads:[~2017-12-18 12:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18 12:16 [Qemu-devel] [PATCH] tpm: add stubs for qdev-prop-tpm Cornelia Huck
2017-12-18 12:27 ` Paolo Bonzini [this message]
2017-12-18 12:35   ` Cornelia Huck
2017-12-18 12:37     ` Marc-André Lureau
2017-12-18 15:58   ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=deba612d-e6f0-7181-6328-7eec81f68034@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.