From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6iVo-0001Oe-Aj for qemu-devel@nongnu.org; Tue, 06 Aug 2013 10:45:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V6iVf-0004nV-V1 for qemu-devel@nongnu.org; Tue, 06 Aug 2013 10:45:24 -0400 Received: from mail-wg0-x22c.google.com ([2a00:1450:400c:c00::22c]:56395) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6iVf-0004nL-Q7 for qemu-devel@nongnu.org; Tue, 06 Aug 2013 10:45:15 -0400 Received: by mail-wg0-f44.google.com with SMTP id l18so437035wgh.35 for ; Tue, 06 Aug 2013 07:45:15 -0700 (PDT) Date: Tue, 6 Aug 2013 16:45:12 +0200 From: Stefan Hajnoczi Message-ID: <20130806144512.GD4373@stefanha-thinkpad.redhat.com> References: <1375639805-1943-1-git-send-email-alex@alex.org.uk> <1375780592-22842-1-git-send-email-alex@alex.org.uk> <1375780592-22842-9-git-send-email-alex@alex.org.uk> <20130806123043.GD30812@stefanha-thinkpad.redhat.com> <37C2525C31EFF8413E621C3E@nimrod.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <37C2525C31EFF8413E621C3E@nimrod.local> Subject: Re: [Qemu-devel] [RFC] [PATCHv6 08/16] aio / timers: Add QEMUTimerListGroup to AioContext List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Bligh Cc: Kevin Wolf , Anthony Liguori , qemu-devel@nongnu.org, liu ping fan , Stefan Hajnoczi , Paolo Bonzini , MORITA Kazutaka , rth@twiddle.net On Tue, Aug 06, 2013 at 01:50:02PM +0100, Alex Bligh wrote: > > > --On 6 August 2013 14:30:43 +0200 Stefan Hajnoczi > 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