]> git.proxmox.com Git - mirror_qemu.git/commitdiff
tpm: add stubs
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Tue, 24 Oct 2017 12:20:43 +0000 (09:20 -0300)
committerStefan Berger <stefanb@linux.vnet.ibm.com>
Wed, 25 Oct 2017 05:05:04 +0000 (01:05 -0400)
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
Makefile.objs
stubs/Makefile.objs
stubs/tpm.c [new file with mode: 0644]

index 12175425a7033e1c1ac351186501cd693a491b0a..265006324231571d9d460f984576676e45c8cbf4 100644 (file)
@@ -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*
index d4f973a8fc7e3752f13c2588f2d46a655ccdfee2..285c6f3c15b95f5ad1b9703849ce377f463076cd 100644 (file)
@@ -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/
 
index c7594796c39e43e3af804013b06cfebefe1c4d08..8cfe34328a4682c04d1d6e36aba0282dbafc9309 100644 (file)
@@ -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 (file)
index 0000000..c18aac1
--- /dev/null
@@ -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;
+}