tpm: add stubs to fix compiling with --disable-tpm
cover tpm: add stubs to fix compiling with --disable-tpm
This fixes building with --disable-tpm as reported by Zoltan:
http://lists.nongnu.org/archive/html/qemu-devel/2017-10/msg05369.html
Cc'ing Peter in case this enters as build fix instead of via trivial.
Regards,
Phil.
Philippe Mathieu-Daudé (3):
tpm: add missing include
tpm: add stubs
vl: remove unnecessary #ifdef CONFIG_TPM
Makefile.objs | 2 +- include/sysemu/tpm.h | 1 + stubs/tpm.c | 33 +++++++++++++++++++++++++++++++++ vl.c | 2 -- MAINTAINERS | 1 + stubs/Makefile.objs | 1 + 6 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 stubs/tpm.c
Signature · 1 line
2.15.0.rc1
PATCH 1/3 tpm: add missing include
else files including "sysemu/tpm.h" fail to compile:
In file included from qemu/stubs/tpm.c:2:0:
qemu/include/sysemu/tpm.h:36:19: error: implicit declaration of function ‘object_resolve_path_type’ [-Werror=implicit-function-declaration]
Object *obj = object_resolve_path_type("", TYPE_TPM_TIS, NULL);
^~~~~~~~~~~~~~~~~~~~~~~~--- include/sysemu/tpm.h | 1 + 1 file changed, 1 insertion(+)
include/sysemu/tpm.h +1 -0
@@ -13,6 +13,7 @@#define QEMU_TPM_H #include "qemu/option.h" +#include "qom/object.h" typedef struct TPMState TPMState ;
Signature · 1 line
2.15.0.rc1
PATCH 2/3 tpm: add stubs
In reply to Philippe Mathieu-Daudéthis fixes compile with --disable-tpm
Message-Id: <[email protected]>
--- Makefile.objs | 2 +- stubs/tpm.c | 33 +++++++++++++++++++++++++++++++++ MAINTAINERS | 1 + stubs/Makefile.objs | 1 + 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 stubs/tpm.c
Makefile.objs +1 -1
@@ -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/
stubs/tpm.c new file +33 -0
@@ -0,0 +1,33 @@ +/* +* TPM configuration +* +* 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 ; +}
MAINTAINERS +1 -0
@@ -1544,6 +1544,7 @@ TPM M: Stefan Berger <[email protected]> S: Maintained F: tpm.c +F: stubs/tpm.c F: hw/tpm/* F: include/hw/acpi/tpm.h F: include/sysemu/tpm*
stubs/Makefile.objs +1 -0
@@ -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
Signature · 1 line
2.15.0.rc1
PATCH 3/3 vl: remove unnecessary #ifdef CONFIG_TPM
In reply to Philippe Mathieu-Daudéa stub is now provided.
--- vl.c | 2 -- 1 file changed, 2 deletions(-)
vl.c +0 -2
@@ -4624,11 +4624,9 @@ int main(int argc, char **argv, char **envp)exit (1 ); } -#ifdef CONFIG_TPM if (tpm_init () <0 ) {exit (1 ); } -#endif /* init the bluetooth world */ if (foreach_device_config (DEV_BT , bt_parse))
Signature · 1 line
2.15.0.rc1
Re: [Qemu-devel] [PATCH 3/3] vl: remove unnecessary #ifdef CONFIG_TPM
The series fixes the build for me, thanks :-)
Rich.
Signature · 5 lines
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Re: [Qemu-devel] [PATCH 3/3] vl: remove unnecessary #ifdef CONFIG_TPM
Hi Richard,
Quoted 1 line · Richard W.M. Jones
The series fixes the build for me, thanks :-)
Good, does this mean I can add your Tested-by: tag?
Regards,
Phil.
Richard W.M. Jones
Tested-byRe: [Qemu-devel] [PATCH 3/3] vl: remove unnecessary #ifdef CONFIG_TPM
Quoted 6 lines · Philippe Mathieu-Daudé
Hi Richard,
Quoted 1 line · Richard W.M. Jones
The series fixes the build for me, thanks :-)
Good, does this mean I can add your Tested-by: tag?
Sure,
Rich.
Signature · 5 lines
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Re: [Qemu-devel] [PATCH 3/3] vl: remove unnecessary #ifdef CONFIG_TPM
In reply to Philippe Mathieu-DaudéQuoted 13 lines · Philippe Mathieu-Daudé
a stub is now provided.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- vl.c | 2 -- 1 file changed, 2 deletions(-)vl.c +0
-0@@ -4624,11 +4624,9 @@ int main(int argc, char **argv, char **envp)exit (1 );
vl.c int main(int argc, char **argv, char **envp) · line 4632
Quoted 10 lines
vl.c +0
-2} -#ifdef CONFIG_TPM if (tpm_init () <0 ) {exit (1 ); } -#endif /* init the bluetooth world */ if (foreach_device_config (DEV_BT , bt_parse))
Now you should be able to also remove the #ifdef CONFIG_TPM from ./tpm.c.
Stefan