From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYv4T-0007He-7D for qemu-devel@nongnu.org; Fri, 20 Mar 2015 07:26:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYv4O-0003Ah-9q for qemu-devel@nongnu.org; Fri, 20 Mar 2015 07:26:33 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:52712) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYv4O-0003A2-1T for qemu-devel@nongnu.org; Fri, 20 Mar 2015 07:26:28 -0400 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 20 Mar 2015 05:26:25 -0600 Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 06A041FF0023 for ; Fri, 20 Mar 2015 05:17:33 -0600 (MDT) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t2KBQEgQ42008588 for ; Fri, 20 Mar 2015 04:26:14 -0700 Received: from d03av02.boulder.ibm.com (localhost [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t2KBQIpg027856 for ; Fri, 20 Mar 2015 05:26:21 -0600 Message-ID: <550C03D8.7000606@linux.vnet.ibm.com> Date: Fri, 20 Mar 2015 07:26:16 -0400 From: Stefan Berger MIME-Version: 1.0 References: <1425989673-2812-1-git-send-email-quan.xu@intel.com> <1425989673-2812-6-git-send-email-quan.xu@intel.com> In-Reply-To: <1425989673-2812-6-git-send-email-quan.xu@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 5/5] 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 , stefano.stabellini@eu.citrix.com, qemu-devel@nongnu.org, armbru@redhat.com, lcapitulino@redhat.com, aliguori@amazon.com, pbonzini@redhat.com, eblake@redhat.com, kraxel@redhat.com, meyering@redhat.com, mjt@tls.msk.ru, sw@weilnetz.de, wei.liu2@citrix.com Cc: xen-devel@lists.xen.org On 03/10/2015 08:14 AM, Quan Xu wrote: > make sure QEMU machine class is initialized and QEMU has registered > Xen stubdom vTPM driver when call tpm_init() > > Signed-off-by: Quan Xu > --- > vl.c | 17 +++++++++++------ > 1 file changed, 11 insertions(+), 6 deletions(-) > > diff --git a/vl.c b/vl.c > index f6b3546..0bbdaa1 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,17 @@ 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); Reviewed-by: Stefan Berger