Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N1015-0001Eo-NE for qemu-devel@nongnu.org; Thu, 22 Oct 2009 11:55:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N1011-0001Dd-1B for qemu-devel@nongnu.org; Thu, 22 Oct 2009 11:55:55 -0400 Received: from [199.232.76.173] (port=48086 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N1010-0001Da-Us for qemu-devel@nongnu.org; Thu, 22 Oct 2009 11:55:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65003) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N1010-00040o-DO for qemu-devel@nongnu.org; Thu, 22 Oct 2009 11:55:50 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9MFtnZY026709 for ; Thu, 22 Oct 2009 11:55:49 -0400 From: Kevin Wolf Date: Thu, 22 Oct 2009 17:54:34 +0200 Message-Id: <1256226882-26434-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 0/8] Fix bdrv_read/write emulation List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf The other day we re-introduced synchronous qcow2 read/write functions to work around the buggy bdrv_read/write emulation, this series implements the proper fix for it. Basically what it's doing is to ensure that the emulation only runs its own AIO callbacks and bottom halves. Callbacks from outside need to wait so they can't corrupt the internal state of the driver calling bdrv_read/write (and assuming that nobody else runs in between). Kevin Wolf (8): posix-aio-compat: Split out posix_aio_process_queue Add qemu_aio_process_queue() Split out bottom halves Introduce contexts for asynchronous callbacks block: Use new AsyncContext for bdrv_read/write emulation posix-aio-compat: Honour AsyncContext linux-aio: Honour AsyncContext Revert "qcow2: Bring synchronous read/write back to life" Makefile.target | 2 +- aio.c | 30 +++++++ async.c | 216 +++++++++++++++++++++++++++++++++++++++++++++++++ block.c | 22 ++++- block/curl.c | 8 +- block/qcow2-cluster.c | 6 +- block/qcow2.c | 51 +----------- block/qcow2.h | 3 - linux-aio.c | 87 ++++++++++++++++---- posix-aio-compat.c | 58 +++++++++---- qemu-aio.h | 13 +++ qemu-common.h | 5 + qemu-tool.c | 13 +++ vl.c | 104 ----------------------- 14 files changed, 418 insertions(+), 200 deletions(-) create mode 100644 async.c