From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzUQ3-0000BD-Jy for qemu-devel@nongnu.org; Wed, 17 Jul 2013 12:17:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UzUQ2-0004s0-Gi for qemu-devel@nongnu.org; Wed, 17 Jul 2013 12:17:35 -0400 Received: from mail.avalus.com ([2001:41c8:10:1dd::10]:47967) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzUIv-0000st-7P for qemu-devel@nongnu.org; Wed, 17 Jul 2013 12:10:13 -0400 Date: Wed, 17 Jul 2013 17:09:58 +0100 From: Alex Bligh Message-ID: <590E9EFE8A032DDDFD6502F1@nimrod.local> In-Reply-To: <51E6519B.6060609@redhat.com> References: <51E4613D.9000106@redhat.com> <44590808AF4A6E7DC093637A@nimrod.local> <51E4E54A.10908@redhat.com> <51E4F77C.2090509@redhat.com> <794E19D97CCC267CCBFA8397@Ximines.local> <51E56A1A.50502@redhat.com> <19631228D7B62545DC6A2928@Ximines.local> <51E57AF3.1050409@redhat.com> <20130717030230.GA27807@stefanha-thinkpad.redhat.com> <9EDD71F21C4D65014805FB9B@nimrod.local> <51E6519B.6060609@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Re: [Qemu-devel] [PATCH] [RFC] aio/async: Add timed bottom-halves Reply-To: Alex Bligh List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , Anthony Liguori , Alex Bligh , Stefan Hajnoczi , qemu-devel@nongnu.org, Stefan Hajnoczi , rth@twiddle.net Paolo, --On 17 July 2013 10:11:07 +0200 Paolo Bonzini wrote: >>> The steps to achieving this: >>> >>> 1. Drop alarm timers from qemu-timer.c and calculate g_poll() timeout >>> instead for the main loop. >>> >>> 2. Introduce a per-AioContext aio_ctx_clock that can be used with >>> qemu_new_timer() to create a QEMUTimer that expires during >>> aio_poll(). >>> >>> 3. Calculate g_poll() timeout for aio_ctx_clock in aio_poll(). >> >> A couple of questions: >> >> 1. How would this work where the user has no main loop, e.g. qemu-img? A >> block driver may well still need timers. > > The block driver should only use aio_ctx_clock, and those _would_ be > handled in aio_poll(). OK, so modify aio_poll not to run qemu_run_all_timers but to run qemu_run_timer on that particular clock. We'd still need to modify some of the executables to call init_timers() or whatever it is, but that's easy enough. I might have a go at that. -- Alex Bligh