From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAgpz-0001xg-4g for qemu-devel@nongnu.org; Mon, 12 Jan 2015 10:23:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAgpt-0006gJ-Al for qemu-devel@nongnu.org; Mon, 12 Jan 2015 10:23:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48020) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAgpt-0006fT-44 for qemu-devel@nongnu.org; Mon, 12 Jan 2015 10:23:21 -0500 Message-ID: <54B3E6DE.5000208@redhat.com> Date: Mon, 12 Jan 2015 16:23:10 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1419980592-18778-1-git-send-email-quan.xu@intel.com> In-Reply-To: <1419980592-18778-1-git-send-email-quan.xu@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [v3 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 , qemu-devel@nongnu.org Cc: aliguori@amazon.com, xen-devel@lists.xen.org On 31/12/2014 00:03, 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 | 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); > This is okay. I think the comment is not necessary, but Stefano can fix that up if he agrees. Paolo