From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7MyY-0004e3-SL for qemu-devel@nongnu.org; Wed, 25 Oct 2017 10:48:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e7MyU-0002uV-SC for qemu-devel@nongnu.org; Wed, 25 Oct 2017 10:48:10 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:36322) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e7MyU-0002tm-Ja for qemu-devel@nongnu.org; Wed, 25 Oct 2017 10:48:06 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9PEkjq4125573 for ; Wed, 25 Oct 2017 10:48:02 -0400 Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.151]) by mx0a-001b2d01.pphosted.com with ESMTP id 2dtvgfrs7c-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 25 Oct 2017 10:48:02 -0400 Received: from localhost by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 25 Oct 2017 08:48:01 -0600 From: Stefan Berger Date: Wed, 25 Oct 2017 10:47:52 -0400 In-Reply-To: <1508942875-21557-1-git-send-email-stefanb@linux.vnet.ibm.com> References: <1508942875-21557-1-git-send-email-stefanb@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Message-Id: <1508942875-21557-3-git-send-email-stefanb@linux.vnet.ibm.com> Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL v1 2/5] tpm: add stubs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Berger From: Philippe Mathieu-Daud=C3=A9 Commit c37cacabf22 moved tpm_cleanup() in the main loop exit, however thi= s function is not available when compiling with --disable-tpm. Provides necessary stubs to keep code clean of #ifdef'fery. Reported-by: BALATON Zoltan Message-Id: <20171023102903.256AF7456A0@zero.eik.bme.hu> Signed-off-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Richard W.M. Jones Reviewed-by: Juan Quintela Signed-off-by: Stefan Berger --- 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 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 :=3D $(BLUEZ_CFLAGS) common-obj-y +=3D dma-helpers.o common-obj-y +=3D vl.o vl.o-cflags :=3D $(GPROF_CFLAGS) $(SDL_CFLAGS) -common-obj-y +=3D tpm.o +common-obj-$(CONFIG_TPM) +=3D tpm.o =20 common-obj-$(CONFIG_SLIRP) +=3D slirp/ =20 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 +=3D runstate-check.o stub-obj-y +=3D set-fd-handler.o stub-obj-y +=3D slirp.o stub-obj-y +=3D sysbus.o +stub-obj-y +=3D tpm.o stub-obj-y +=3D trace-control.o stub-obj-y +=3D uuid.o stub-obj-y +=3D 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 la= ter. + * 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; +} --=20 2.5.5