From 02ce232c5051854bf49e6d2816c65e00f6d7e036 Mon Sep 17 00:00:00 2001 From: Kirill Batuzov Date: Tue, 6 May 2014 16:59:53 +0400 Subject: vl.c: remove init_clocks call from main Clocks are initialized in qemu_init_main_loop. They are not needed before it. Initializing them twice is not only unnecessary but is harmful: it results in memory leak and potentially can lead to a situation where different parts of QEMU use different sets of timers. To avoid it remove init_clocks call from main and add an assertion to qemu_clock_init that corresponding clock has not been initialized yet. Signed-off-by: Kirill Batuzov Signed-off-by: Stefan Hajnoczi --- vl.c | 1 - 1 file changed, 1 deletion(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index 73e06610b0..709d8cda8d 100644 --- a/vl.c +++ b/vl.c @@ -3024,7 +3024,6 @@ int main(int argc, char **argv, char **envp) runstate_init(); - init_clocks(); rtc_clock = QEMU_CLOCK_HOST; qemu_init_auxval(envp); -- cgit v1.2.1