From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45036 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OPeK3-0002xR-Vs for qemu-devel@nongnu.org; Fri, 18 Jun 2010 12:21:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OPeK2-0002N0-QO for qemu-devel@nongnu.org; Fri, 18 Jun 2010 12:21:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27393) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OPeK2-0002Mn-Ft for qemu-devel@nongnu.org; Fri, 18 Jun 2010 12:21:38 -0400 Message-ID: <4C1B9D01.4020801@redhat.com> Date: Fri, 18 Jun 2010 18:21:21 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1276624421-23999-1-git-send-email-morita.kazutaka@lab.ntt.co.jp> <1276624421-23999-3-git-send-email-morita.kazutaka@lab.ntt.co.jp> In-Reply-To: <1276624421-23999-3-git-send-email-morita.kazutaka@lab.ntt.co.jp> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 2/2] qemu-io: check registered fds in command_loop() List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: MORITA Kazutaka Cc: qemu-devel@nongnu.org Am 15.06.2010 19:53, schrieb MORITA Kazutaka: > Some block drivers use an aio handler and do I/O completion routines > in it. However, the handler is not invoked if we only do > aio_read/write, because registered fds are not checked at all. > > This patch registers a command processing function as a fd handler to > STDIO, and calls qemu_aio_wait() in command_loop(). Any other > handlers can be invoked when user input is idle. > > Signed-off-by: MORITA Kazutaka This breaks qemu-iotests. The reason is that synchronous requests get out of order. Previously, do_aio_readv/writev waited until the request was completed, and only afterwards the next command was read from stdio. Now the next command can start during the qemu_aio_wait() that do_aio_readv/writev uses internally to wait. So we either need to deregister the fd handler while a command is running, or (more cleanly) have an async_context_push/pop for any command except aio_*. Kevin