From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42367) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xkscq-0001DJ-51 for qemu-devel@nongnu.org; Sun, 02 Nov 2014 05:43:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xkscl-0006h6-2T for qemu-devel@nongnu.org; Sun, 02 Nov 2014 05:43:12 -0500 Received: from mga11.intel.com ([192.55.52.93]:27381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xksck-0006gk-MQ for qemu-devel@nongnu.org; Sun, 02 Nov 2014 05:43:06 -0500 From: Quan Xu Date: Sun, 2 Nov 2014 01:39:31 -0500 Message-Id: <1414910371-27794-1-git-send-email-quan.xu@intel.com> Subject: [Qemu-devel] [PATCH 4/4] Qemu-Xen-vTPM: QEMU machine class is initialized before tpm_init() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, Quan Xu , aliguori@amazon.com, xen-devel@lists.xen.org make sure QEMU machine class is initialized and QEMU has registered Xen stubdom vTPM driver when call tpm_init() [vl.c] Signed-off-by: Quan Xu --- vl.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/vl.c b/vl.c index f6b3546..dd437e1 100644 --- a/vl.c +++ b/vl.c @@ -4114,12 +4114,6 @@ 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)) exit(1); @@ -4225,6 +4219,16 @@ int main(int argc, char **argv, char **envp) exit(1); } + /* For compatible with Xen stubdom vTPM driver, make + * sure QEMU machine class is initialized and QEMU has + * registered Xen stubdom vTPM driver .. + */ +#ifdef CONFIG_TPM + if (tpm_init() < 0) { + exit(1); + } +#endif + /* init generic devices */ if (qemu_opts_foreach(qemu_find_opts("device"), device_init_func, NULL, 1) != 0) exit(1); -- 1.8.3.2