aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2009-09-18 02:41:23 -0300
committerAurelien Jarno <aurelien@aurel32.net>2009-09-26 23:39:09 +0200
commit214910a7f826ca0cda328b93217e5448f76e19bf (patch)
tree2994a295f079b924ed404999f719d5367ccb7845
parentb4ed5d188f30c738035b50e7c865782f73f7171f (diff)
fix -daemonize with kvm
Otherwise fork might not inherit state initialized by kvm_init(). Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
-rw-r--r--vl.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/vl.c b/vl.c
index e7d923265e..e12f1d3ee0 100644
--- a/vl.c
+++ b/vl.c
@@ -5424,16 +5424,6 @@ int main(int argc, char **argv, char **envp)
}
}
- if (kvm_enabled()) {
- int ret;
-
- ret = kvm_init(smp_cpus);
- if (ret < 0) {
- fprintf(stderr, "failed to initialize KVM\n");
- exit(1);
- }
- }
-
/* If no data_dir is specified then try to find it relative to the
executable path. */
if (!data_dir) {
@@ -5523,6 +5513,16 @@ int main(int argc, char **argv, char **envp)
}
#endif
+ if (kvm_enabled()) {
+ int ret;
+
+ ret = kvm_init(smp_cpus);
+ if (ret < 0) {
+ fprintf(stderr, "failed to initialize KVM\n");
+ exit(1);
+ }
+ }
+
if (qemu_init_main_loop()) {
fprintf(stderr, "qemu_init_main_loop failed\n");
exit(1);