qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [v3 5/5] Qemu-Xen-vTPM: QEMU machine class is initialized before tpm_init()
@ 2014-12-30 23:03 Quan Xu
  2015-01-12 15:23 ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Quan Xu @ 2014-12-30 23:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, Quan Xu, aliguori, xen-devel

make sure QEMU machine class is initialized and QEMU has registered
Xen stubdom vTPM driver when call tpm_init()

Signed-off-by: Quan Xu <quan.xu@intel.com>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [v3 5/5] Qemu-Xen-vTPM: QEMU machine class is initialized before tpm_init()
  2014-12-30 23:03 [Qemu-devel] [v3 5/5] Qemu-Xen-vTPM: QEMU machine class is initialized before tpm_init() Quan Xu
@ 2015-01-12 15:23 ` Paolo Bonzini
  2015-01-12 15:28   ` Xu, Quan
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2015-01-12 15:23 UTC (permalink / raw)
  To: Quan Xu, qemu-devel; +Cc: aliguori, xen-devel



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 <quan.xu@intel.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [v3 5/5] Qemu-Xen-vTPM: QEMU machine class is initialized before tpm_init()
  2015-01-12 15:23 ` Paolo Bonzini
@ 2015-01-12 15:28   ` Xu, Quan
  0 siblings, 0 replies; 3+ messages in thread
From: Xu, Quan @ 2015-01-12 15:28 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel@nongnu.org
  Cc: stefano.stabellini@eu.citrix.com, aliguori@amazon.com,
	xen-devel@lists.xen.org



> -----Original Message-----
> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> Sent: Monday, January 12, 2015 11:23 PM
> To: Xu, Quan; qemu-devel@nongnu.org
> Cc: xen-devel@lists.xen.org; aliguori@amazon.com
> Subject: Re: [v3 5/5] Qemu-Xen-vTPM: QEMU machine class is initialized before
> tpm_init()
> 
> 
> 
> 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 <quan.xu@intel.com>
> > ---
> >  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, Thanks. 
CC Stefano, let him know. 

Quan
> 
> Paolo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-12 15:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-30 23:03 [Qemu-devel] [v3 5/5] Qemu-Xen-vTPM: QEMU machine class is initialized before tpm_init() Quan Xu
2015-01-12 15:23 ` Paolo Bonzini
2015-01-12 15:28   ` Xu, Quan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).