From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59625) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgXcg-0002wF-QJ for qemu-devel@nongnu.org; Tue, 21 Oct 2014 07:29:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XgXcX-00037T-3d for qemu-devel@nongnu.org; Tue, 21 Oct 2014 07:29:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15288) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgXcW-00037P-SK for qemu-devel@nongnu.org; Tue, 21 Oct 2014 07:28:57 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9LBSuPF020551 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 21 Oct 2014 07:28:56 -0400 Message-ID: <54464375.7020106@redhat.com> Date: Tue, 21 Oct 2014 13:28:53 +0200 From: Max Reitz MIME-Version: 1.0 References: <1413889440-32577-1-git-send-email-stefanha@redhat.com> <1413889440-32577-11-git-send-email-stefanha@redhat.com> In-Reply-To: <1413889440-32577-11-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 10/11] block: let commit blockjob run in BDS AioContext List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , Fam Zheng On 2014-10-21 at 13:03, Stefan Hajnoczi wrote: > The commit block job must run in the BlockDriverState AioContext so that > it works with dataplane. > > Acquire the AioContext in blockdev.c so starting the block job is safe. > One detail here is that the bdrv_drain_all() must be moved inside the > aio_context_acquire() region so requests cannot sneak in between the > drain and acquire. > > The completion code in block/commit.c must perform backing chain > manipulation and bdrv_reopen() from the main loop. Use > block_job_defer_to_main_loop() to achieve that. > > Signed-off-by: Stefan Hajnoczi > --- > block/commit.c | 70 ++++++++++++++++++++++++++++++++++++---------------------- > blockdev.c | 29 ++++++++++++++++-------- > 2 files changed, 64 insertions(+), 35 deletions(-) Reviewed-by: Max Reitz