From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlGeT-0005lw-JN for qemu-devel@nongnu.org; Mon, 03 Nov 2014 07:22:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlGeN-0001Ze-L7 for qemu-devel@nongnu.org; Mon, 03 Nov 2014 07:22:29 -0500 Received: from mail-la0-x22e.google.com ([2a00:1450:4010:c03::22e]:36840) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlGeN-0001ZE-B3 for qemu-devel@nongnu.org; Mon, 03 Nov 2014 07:22:23 -0500 Received: by mail-la0-f46.google.com with SMTP id hs14so9552415lab.33 for ; Mon, 03 Nov 2014 04:22:21 -0800 (PST) Sender: Paolo Bonzini Message-ID: <54577379.3060009@redhat.com> Date: Mon, 03 Nov 2014 13:22:17 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1414910371-27794-1-git-send-email-quan.xu@intel.com> In-Reply-To: <1414910371-27794-1-git-send-email-quan.xu@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [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: Quan Xu , qemu-devel@nongnu.org Cc: aliguori@amazon.com, xen-devel@lists.xen.org On 02/11/2014 07:39, Quan Xu wrote: > 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); > Assuming you tested the non-Xen TPM backend, this is okay. Paolo