From: Marcelo Tosatti <[email protected]>

Move kvm_init after fork.

Signed-off-by: Marcelo Tosatti <[email protected]>

diff --git a/vl.c b/vl.c
index 888d481..88bd3eb 100644
--- a/vl.c
+++ b/vl.c
@@ -5533,20 +5533,6 @@ int main(int argc, char **argv, char **envp)
         }
     }
 
-    if (kvm_enabled()) {
-        int ret;
-
-        ret = kvm_init(smp_cpus);
-        if (ret < 0) {
-#if defined(KVM_UPSTREAM) || defined(NO_CPU_EMULATION)
-            fprintf(stderr, "failed to initialize KVM\n");
-            exit(1);
-#endif
-            fprintf(stderr, "Could not initialize KVM, will disable KVM 
support\n");
-            kvm_allowed = 0;
-        }
-    }
-
     /* If no data_dir is specified then try to find it relative to the
        executable path.  */
     if (!data_dir) {
@@ -5636,6 +5622,20 @@ int main(int argc, char **argv, char **envp)
     }
 #endif
 
+    if (kvm_enabled()) {
+        int ret;
+
+        ret = kvm_init(smp_cpus);
+        if (ret < 0) {
+#if defined(KVM_UPSTREAM) || defined(NO_CPU_EMULATION)
+            fprintf(stderr, "failed to initialize KVM\n");
+            exit(1);
+#endif
+            fprintf(stderr, "Could not initialize KVM, will disable KVM 
support\n");
+            kvm_allowed = 0;
+        }
+    }
+
     if (qemu_init_main_loop()) {
         fprintf(stderr, "qemu_init_main_loop failed\n");
         exit(1);
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to