From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTxdc-0006Id-Sd for qemu-devel@nongnu.org; Thu, 01 Nov 2012 12:29:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTxdb-00018E-PE for qemu-devel@nongnu.org; Thu, 01 Nov 2012 12:29:00 -0400 Received: from mout.web.de ([212.227.17.12]:61312) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTxdb-000188-Da for qemu-devel@nongnu.org; Thu, 01 Nov 2012 12:28:59 -0400 Message-ID: <5092A274.8000503@web.de> Date: Thu, 01 Nov 2012 17:25:24 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <20121101152109.GD15210@hedwig.ini.cmu.edu> In-Reply-To: <20121101152109.GD15210@hedwig.ini.cmu.edu> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] Reorder alarm timer setup again List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Anthony Liguori Cc: Paolo Bonzini , "Gabriel L. Somlo" From: Jan Kiszka 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 Signed-off-by: Jan Kiszka --- vl.c | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) 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"); -- 1.7.3.4