Skip to contentSkip to conversation

Qemu-Xen-vTPM: QEMU machine class is initialized before tpm_init()

PATCH Superseded Quan Xu 2 participants 5 messages Dec 31, 2014 – Jan 12, 2015

v3 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

Quan Xu

author
#0 lore raw

PATCH v3 5/5 Qemu-Xen-vTPM: QEMU machine class is initialized before tpm_init()

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

---
 vl.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
vl.c +10 -6
index f6b3546..dd437e1 100644
@@ -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);
Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 33 lines · Quan Xu

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

---
 vl.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
vl.c +3 -6
index f6b3546..dd437e1 100644
@@ -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 ..

vl.c int main(int argc, char **argv, char **envp) · line 4234

Quoted 10 lines
vl.c +7 -0
+    */
+#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

#2 lore raw
In reply to Quan Xu
Quoted 33 lines · Quan Xu

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

---
 vl.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
vl.c +3 -6
index f6b3546..dd437e1 100644
@@ -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 ..

vl.c int main(int argc, char **argv, char **envp) · line 4234

Quoted 10 lines
vl.c +7 -0
+    */
+#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

author
#3 lore raw
Quoted 55 lines

-----Original Message-----
From: Paolo Bonzini [mailto:[email protected]]
Sent: Monday, January 12, 2015 11:23 PM
To: Xu, Quan; [email protected]
Cc: [email protected]; [email protected]
Subject: Re: [v3 5/5] Qemu-Xen-vTPM: QEMU machine class is initialized before tpm_init()

Quoted 31 lines · Quan Xu

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

---
 vl.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
vl.c +2 -6
index f6b3546..dd437e1 100644
@@ -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

vl.c int main(int argc, char **argv, char **envp) · line 4233

Quoted 10 lines
vl.c +8 -0
+     * 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)

Quoted 5 lines

vl.c int main(int argc, char **argv, char **envp) · line 4234

Quoted 2 lines
vl.c +0 -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

Quoted 2 lines

Paolo

author
#4 lore raw
In reply to Paolo Bonzini
Quoted 55 lines

-----Original Message-----
From: Paolo Bonzini [mailto:[email protected]]
Sent: Monday, January 12, 2015 11:23 PM
To: Xu, Quan; [email protected]
Cc: [email protected]; [email protected]
Subject: Re: [v3 5/5] Qemu-Xen-vTPM: QEMU machine class is initialized before tpm_init()

Quoted 31 lines · Quan Xu

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

---
 vl.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
vl.c +2 -6
index f6b3546..dd437e1 100644
@@ -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

vl.c int main(int argc, char **argv, char **envp) · line 4233

Quoted 10 lines
vl.c +8 -0
+     * 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)

Quoted 5 lines

vl.c int main(int argc, char **argv, char **envp) · line 4234

Quoted 2 lines
vl.c +0 -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

Quoted 2 lines

Paolo