From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDFIV-0000N4-9e for qemu-devel@nongnu.org; Fri, 01 Aug 2014 12:03:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XDFIO-0002Tv-Sc for qemu-devel@nongnu.org; Fri, 01 Aug 2014 12:03:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52474) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDFIO-0002Tk-Ki for qemu-devel@nongnu.org; Fri, 01 Aug 2014 12:03:04 -0400 Message-ID: <53DBBA34.7020803@redhat.com> Date: Fri, 01 Aug 2014 18:03:00 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1404899590-24973-1-git-send-email-pbonzini@redhat.com> <1404899590-24973-2-git-send-email-pbonzini@redhat.com> <20140801143447.GC11091@stefanha-thinkpad.redhat.com> In-Reply-To: <20140801143447.GC11091@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 01/10] AioContext: take bottom halves into account when computing aio_poll timeout List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org Il 01/08/2014 16:34, Stefan Hajnoczi ha scritto: > On Wed, Jul 09, 2014 at 11:53:01AM +0200, Paolo Bonzini wrote: >> diff --git a/async.c b/async.c >> index 34af0b2..ac40eab 100644 >> --- a/async.c >> +++ b/async.c >> @@ -152,39 +152,43 @@ void qemu_bh_delete(QEMUBH *bh) >> bh->deleted = 1; >> } >> >> -static gboolean >> -aio_ctx_prepare(GSource *source, gint *timeout) >> +int >> +aio_compute_timeout(AioContext *ctx) > > The return value is now nanoseconds so a 32-bit int doesn't offer much > range (only 2 seconds for a signed int). > > Any reason to use int instead of int64_t as used by the timer API? Can you squash the obvious diff --git a/async.c b/async.c index ac40eab..09e09c6 100644 --- a/async.c +++ b/async.c @@ -152,7 +152,7 @@ void qemu_bh_delete(QEMUBH *bh) bh->deleted = 1; } -int +int64_t aio_compute_timeout(AioContext *ctx) { int64_t deadline; diff --git a/include/block/aio.h b/include/block/aio.h index 7eeb961..05b531c 100644 --- a/include/block/aio.h +++ b/include/block/aio.h @@ -309,6 +309,6 @@ static inline void aio_timer_init(AioContext *ctx, * * Compute the timeout that a blocking aio_poll should use. */ -int aio_compute_timeout(AioContext *ctx); +int64_t aio_compute_timeout(AioContext *ctx); #endif yourself, or should I send v2 of this patch or the whole series? Paolo