From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULMNo-00086z-DL for qemu-devel@nongnu.org; Thu, 28 Mar 2013 19:37:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULMNn-00017B-7m for qemu-devel@nongnu.org; Thu, 28 Mar 2013 19:37:24 -0400 Received: from mail-ee0-f51.google.com ([74.125.83.51]:58313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULMNn-000175-2K for qemu-devel@nongnu.org; Thu, 28 Mar 2013 19:37:23 -0400 Received: by mail-ee0-f51.google.com with SMTP id c4so23984eek.38 for ; Thu, 28 Mar 2013 16:37:22 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <5154D42E.70804@redhat.com> Date: Fri, 29 Mar 2013 00:37:18 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1364507550-25093-1-git-send-email-aliguori@us.ibm.com> <1364507550-25093-2-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1364507550-25093-2-git-send-email-aliguori@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 1/3] aio-context: if io_flush isn't provided, assume "always busy" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Kevin Wolf , Paolo Bonzini , qemu-devel@nongnu.org, Mike Roth Il 28/03/2013 22:52, Anthony Liguori ha scritto: > Today, all callers of qemu_aio_set_fd_handler() pass a valid io_flush > function. Except one: aio_set_event_notifier(ctx, &ctx->notifier, (EventNotifierHandler *) event_notifier_test_and_clear, NULL); This is the EventNotifier that is used by qemu_notify_event. It's quite surprising that this patch works and passes the tests. /me reads cover letter... ah, it is untested. :) But if you can eliminate the sole usage of aio_wait()'s return value (in bdrv_drain_all()), everything would be much simpler. There is a relatively convenient assert(QLIST_EMPTY(&bs->tracked_requests)); that you can use as the exit condition instead. Perhaps it's not trivial to do it efficiently, but it's not a fast path. Paolo > However, the function allows the handler to be omitted > and the behavior is a bit strange. > > It will still add the file descriptor to the GSource but it will > not consider the source to be "busy". This could lead to aio_flush() > returning prematurely. > > Since we never rely on this behavior today, it doesn't matter but > the next patch will start relying on an absent io_flush function > to assume the handler is always busy.