From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Stefan Berger" <stefanb@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PULL v1 2/5] tpm: add stubs
Date: Wed, 25 Oct 2017 10:47:52 -0400 [thread overview]
Message-ID: <1508942875-21557-3-git-send-email-stefanb@linux.vnet.ibm.com> (raw)
In-Reply-To: <1508942875-21557-1-git-send-email-stefanb@linux.vnet.ibm.com>
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Commit c37cacabf22 moved tpm_cleanup() in the main loop exit, however this
function is not available when compiling with --disable-tpm.
Provides necessary stubs to keep code clean of #ifdef'fery.
Reported-by: BALATON Zoltan <balaton@eik.bme.hu>
Message-Id: <20171023102903.256AF7456A0@zero.eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
---
MAINTAINERS | 1 +
Makefile.objs | 2 +-
stubs/Makefile.objs | 1 +
stubs/tpm.c | 33 +++++++++++++++++++++++++++++++++
4 files changed, 36 insertions(+), 1 deletion(-)
create mode 100644 stubs/tpm.c
diff --git a/MAINTAINERS b/MAINTAINERS
index 1217542..2650063 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1544,6 +1544,7 @@ TPM
M: Stefan Berger <stefanb@linux.vnet.ibm.com>
S: Maintained
F: tpm.c
+F: stubs/tpm.c
F: hw/tpm/*
F: include/hw/acpi/tpm.h
F: include/sysemu/tpm*
diff --git a/Makefile.objs b/Makefile.objs
index d4f973a..285c6f3 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -62,7 +62,7 @@ bt-host.o-cflags := $(BLUEZ_CFLAGS)
common-obj-y += dma-helpers.o
common-obj-y += vl.o
vl.o-cflags := $(GPROF_CFLAGS) $(SDL_CFLAGS)
-common-obj-y += tpm.o
+common-obj-$(CONFIG_TPM) += tpm.o
common-obj-$(CONFIG_SLIRP) += slirp/
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index c759479..8cfe343 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -28,6 +28,7 @@ stub-obj-y += runstate-check.o
stub-obj-y += set-fd-handler.o
stub-obj-y += slirp.o
stub-obj-y += sysbus.o
+stub-obj-y += tpm.o
stub-obj-y += trace-control.o
stub-obj-y += uuid.o
stub-obj-y += vm-stop.o
diff --git a/stubs/tpm.c b/stubs/tpm.c
new file mode 100644
index 0000000..c18aac1
--- /dev/null
+++ b/stubs/tpm.c
@@ -0,0 +1,33 @@
+/*
+ * TPM stubs
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#include "qemu/osdep.h"
+#include "sysemu/tpm.h"
+#include "qmp-commands.h"
+
+int tpm_init(void)
+{
+ return 0;
+}
+
+void tpm_cleanup(void)
+{
+}
+
+TPMInfoList *qmp_query_tpm(Error **errp)
+{
+ return NULL;
+}
+
+TpmTypeList *qmp_query_tpm_types(Error **errp)
+{
+ return NULL;
+}
+
+TpmModelList *qmp_query_tpm_models(Error **errp)
+{
+ return NULL;
+}
--
2.5.5
next prev parent reply other threads:[~2017-10-25 14:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-25 14:47 [Qemu-devel] [PULL v1 0/5] Merge tpm 2017/10/24 Stefan Berger
2017-10-25 14:47 ` [Qemu-devel] [PULL v1 1/5] tpm: add missing include Stefan Berger
2017-10-25 14:47 ` Stefan Berger [this message]
2017-10-25 14:47 ` [Qemu-devel] [PULL v1 3/5] tpm: remove unnecessary #ifdef CONFIG_TPM Stefan Berger
2017-10-25 14:47 ` [Qemu-devel] [PULL v1 4/5] vl: " Stefan Berger
2017-10-25 14:47 ` [Qemu-devel] [PULL v1 5/5] tpm: print buffers received from TPM when debugging Stefan Berger
2017-10-26 16:45 ` [Qemu-devel] [PULL v1 0/5] Merge tpm 2017/10/24 Peter Maydell
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=1508942875-21557-3-git-send-email-stefanb@linux.vnet.ibm.com \
--to=stefanb@linux.vnet.ibm.com \
--cc=f4bug@amsat.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).