From patchwork Tue Jan 26 13:47:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 573303 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A62D61402C0 for ; Wed, 27 Jan 2016 01:11:34 +1100 (AEDT) Received: from localhost ([::1]:44159 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO4LE-0005Ks-Kf for incoming@patchwork.ozlabs.org; Tue, 26 Jan 2016 09:11:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO3z0-0001GE-Nh for qemu-devel@nongnu.org; Tue, 26 Jan 2016 08:48:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aO3yy-0004IT-GQ for qemu-devel@nongnu.org; Tue, 26 Jan 2016 08:48:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32867) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO3yy-0004IP-Ao for qemu-devel@nongnu.org; Tue, 26 Jan 2016 08:48:32 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id DE78C3B758; Tue, 26 Jan 2016 13:48:31 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-67.ams2.redhat.com [10.36.112.67]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0QDlNqs028272; Tue, 26 Jan 2016 08:48:30 -0500 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 26 Jan 2016 14:47:15 +0100 Message-Id: <1453816041-36362-44-git-send-email-pbonzini@redhat.com> In-Reply-To: <1453816041-36362-1-git-send-email-pbonzini@redhat.com> References: <1453816041-36362-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , "Denis V. Lunev" Subject: [Qemu-devel] [PULL 43/49] nbd: add missed aio_context_acquire in nbd_export_new X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Denis V. Lunev" blk_invalidate_cache() can call qcow2_invalidate_cache which performs IO inside. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Paolo Bonzini Message-Id: <1453273940-15382-3-git-send-email-den@openvz.org> Signed-off-by: Paolo Bonzini --- nbd/server.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nbd/server.c b/nbd/server.c index eead339..3596e68 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -671,7 +671,9 @@ NBDExport *nbd_export_new(BlockBackend *blk, off_t dev_offset, off_t size, * that BDRV_O_INCOMING is cleared and the image is ready for write * access since the export could be available before migration handover. */ + aio_context_acquire(exp->ctx); blk_invalidate_cache(blk, NULL); + aio_context_release(exp->ctx); return exp; fail: