On Tue, Aug 06, 2013 at 01:50:02PM +0100, Alex Bligh wrote: > > > --On 6 August 2013 14:30:43 +0200 Stefan Hajnoczi > <stefa...@redhat.com> wrote: > > >On Tue, Aug 06, 2013 at 10:16:24AM +0100, Alex Bligh wrote: > >>@@ -628,6 +629,8 @@ int main(int argc, char **argv) > >> { > >> GSource *src; > >> > >>+ init_clocks(); > >>+ > > > >Why add this call now? > > Because otherwise make check SEGVs after the patch.
It wasn't clear from the patch why there would be a crash. I looked deeper and timerlistgroup_init() calls qemu_get_clock() indirectly, so we need to make sure that qemu_clocks[] is initialized to avoid a NULL pointer dereference. Now I'm confident that these init_clocks() are needed in this patch. > >Are there any other programs where this should > >be added too? > > I believe not (at least make check does not fail anything). I have checked that qemu-io, qemu-img, and qemu-nbd are okay because they call qemu_init_main_loop(), which calls init_clocks(). Stefan