diff mbox

Reorder alarm timer setup again

Message ID 5092A274.8000503@web.de
State New
Headers show

Commit Message

Jan Kiszka Nov. 1, 2012, 4:25 p.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

ac4119c023 moved the alarm timer initialization to an earlier point but
failed to consider that it depends on qemu_init_main_loop. Instead of
moving the wrong things before os_daemonize, better push alarm timer
right after qemu_init_main_loop and move the chardev initialization
after this.

Reported-by: Gabriel L. Somlo <gsomlo@gmail.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 vl.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

Comments

Luiz Capitulino Nov. 22, 2012, 3:07 p.m. UTC | #1
On Thu, 01 Nov 2012 17:25:24 +0100
Jan Kiszka <jan.kiszka@web.de> wrote:

> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> ac4119c023 moved the alarm timer initialization to an earlier point but
> failed to consider that it depends on qemu_init_main_loop. Instead of
> moving the wrong things before os_daemonize, better push alarm timer
> right after qemu_init_main_loop and move the chardev initialization
> after this.

Jan, it seems that you have to rebase this patch.
Jan Kiszka Nov. 22, 2012, 3:55 p.m. UTC | #2
On 2012-11-22 16:07, Luiz Capitulino wrote:
> On Thu, 01 Nov 2012 17:25:24 +0100
> Jan Kiszka <jan.kiszka@web.de> wrote:
> 
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> ac4119c023 moved the alarm timer initialization to an earlier point but
>> failed to consider that it depends on qemu_init_main_loop. Instead of
>> moving the wrong things before os_daemonize, better push alarm timer
>> right after qemu_init_main_loop and move the chardev initialization
>> after this.
> 
> Jan, it seems that you have to rebase this patch.

This issue was fixed indirectly by an already merged changeset of Paolo
- IIRC now.

Jan
diff mbox

Patch

diff --git a/vl.c b/vl.c
index 5513d15..e27839a 100644
--- a/vl.c
+++ b/vl.c
@@ -3551,15 +3551,8 @@  int main(int argc, char **argv, char **envp)
             add_device_config(DEV_VIRTCON, "vc:80Cx24C");
     }
 
-    if (init_timer_alarm() < 0) {
-        fprintf(stderr, "could not initialize alarm timer\n");
-        exit(1);
-    }
-
     socket_init();
 
-    if (qemu_opts_foreach(qemu_find_opts("chardev"), chardev_init_func, NULL, 1) != 0)
-        exit(1);
 #ifdef CONFIG_VIRTFS
     if (qemu_opts_foreach(qemu_find_opts("fsdev"), fsdev_init_func, NULL, 1) != 0) {
         exit(1);
@@ -3591,6 +3584,16 @@  int main(int argc, char **argv, char **envp)
         exit(1);
     }
 
+    if (init_timer_alarm() < 0) {
+        fprintf(stderr, "could not initialize alarm timer\n");
+        exit(1);
+    }
+
+    if (qemu_opts_foreach(qemu_find_opts("chardev"), chardev_init_func,
+                          NULL, 1) != 0) {
+        exit(1);
+    }
+
     machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0);
     if (machine_opts) {
         kernel_filename = qemu_opt_get(machine_opts, "kernel");