Skip to content
Snippets Groups Projects
Commit e542b718 authored by Stefan Berger's avatar Stefan Berger
Browse files

sysemu: Make TPM structures inaccessible if CONFIG_TPM is not defined


Signed-off-by: default avatarStefan Berger <stefanb@linux.ibm.com>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210614191335.1968807-5-stefanb@linux.ibm.com>
[PMD: Remove tpm_init() / tpm_cleanup() stubs]
Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
parent 295f7dcb
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,8 @@
#include "qapi/qapi-types-tpm.h"
#include "qom/object.h"
#ifdef CONFIG_TPM
int tpm_config_parse(QemuOptsList *opts_list, const char *optarg);
int tpm_init(void);
void tpm_cleanup(void);
......@@ -73,4 +75,11 @@ static inline TPMVersion tpm_get_version(TPMIf *ti)
return TPM_IF_GET_CLASS(ti)->get_version(ti);
}
#else /* CONFIG_TPM */
#define tpm_init() (0)
#define tpm_cleanup()
#endif /* CONFIG_TPM */
#endif /* QEMU_TPM_H */
......@@ -18,6 +18,8 @@
#include "sysemu/tpm.h"
#include "qapi/error.h"
#ifdef CONFIG_TPM
#define TYPE_TPM_BACKEND "tpm-backend"
OBJECT_DECLARE_TYPE(TPMBackend, TPMBackendClass,
TPM_BACKEND)
......@@ -209,4 +211,6 @@ TPMInfo *tpm_backend_query_tpm(TPMBackend *s);
TPMBackend *qemu_find_tpm_be(const char *id);
#endif
#endif /* CONFIG_TPM */
#endif /* TPM_BACKEND_H */
......@@ -7,18 +7,8 @@
#include "qemu/osdep.h"
#include "qapi/qapi-commands-tpm.h"
#include "sysemu/tpm.h"
#include "hw/acpi/tpm.h"
int tpm_init(void)
{
return 0;
}
void tpm_cleanup(void)
{
}
TPMInfoList *qmp_query_tpm(Error **errp)
{
return NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment