From nobody Thu May 2 07:31:53 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1508760207317283.0811399024593; Mon, 23 Oct 2017 05:03:27 -0700 (PDT) Received: from localhost ([::1]:38442 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6bRn-0006Vk-7b for importer@patchew.org; Mon, 23 Oct 2017 08:03:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6bQm-0006Ek-UA for qemu-devel@nongnu.org; Mon, 23 Oct 2017 08:02:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6bQh-0008AH-2U for qemu-devel@nongnu.org; Mon, 23 Oct 2017 08:02:08 -0400 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:14962) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e6bQg-0008A1-SU for qemu-devel@nongnu.org; Mon, 23 Oct 2017 08:02:03 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 130C67456A5; Mon, 23 Oct 2017 14:02:01 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id DE9BC74569A; Mon, 23 Oct 2017 14:02:00 +0200 (CEST) From: BALATON Zoltan Date: Mon, 23 Oct 2017 12:24:59 +0200 To: qemu-devel@nongnu.org Message-Id: <20171023120200.DE9BC74569A@zero.eik.bme.hu> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:738:2001:2001::2001 Subject: [Qemu-devel] [PATCH v2] Fix compile with --disable-tpm X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Philippe Mathieu-Daude , Stefan Berger Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: BALATON Zoltan Tested-by: Stefan Berger --- tpm.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/tpm.c b/tpm.c index 45520f5..ed78ead 100644 --- a/tpm.c +++ b/tpm.c @@ -30,8 +30,6 @@ void tpm_register_model(enum TpmModel model) tpm_models[model] =3D true; } =20 -#ifdef CONFIG_TPM - static const TPMBackendClass * tpm_be_find_by_type(enum TpmType type) { @@ -48,6 +46,8 @@ tpm_be_find_by_type(enum TpmType type) return TPM_BACKEND_CLASS(oc); } =20 +#ifdef CONFIG_TPM + /* * Walk the list of available TPM backend drivers and display them on the * screen. @@ -146,20 +146,6 @@ static int tpm_init_tpmdev(void *dummy, QemuOpts *opts= , Error **errp) } =20 /* - * Walk the list of TPM backend drivers that are in use and call their - * destroy function to have them cleaned up. - */ -void tpm_cleanup(void) -{ - TPMBackend *drv, *next; - - QLIST_FOREACH_SAFE(drv, &tpm_backends, list, next) { - QLIST_REMOVE(drv, list); - object_unref(OBJECT(drv)); - } -} - -/* * Initialize the TPM. Process the tpmdev command line options describing = the * TPM backend. */ @@ -195,6 +181,20 @@ int tpm_config_parse(QemuOptsList *opts_list, const ch= ar *optarg) #endif /* CONFIG_TPM */ =20 /* + * Walk the list of TPM backend drivers that are in use and call their + * destroy function to have them cleaned up. + */ +void tpm_cleanup(void) +{ + TPMBackend *drv, *next; + + QLIST_FOREACH_SAFE(drv, &tpm_backends, list, next) { + QLIST_REMOVE(drv, list); + object_unref(OBJECT(drv)); + } +} + +/* * Walk the list of active TPM backends and collect information about them * following the schema description in qapi-schema.json. */ @@ -208,8 +208,9 @@ TPMInfoList *qmp_query_tpm(Error **errp) continue; } info =3D g_new0(TPMInfoList, 1); +#ifdef CONFIG_TPM info->value =3D tpm_backend_query_tpm(drv); - +#endif if (!cur_item) { head =3D cur_item =3D info; } else { --=20 2.7.6