From patchwork Wed Jun 19 15:26:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Reitz X-Patchwork-Id: 1118787 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45TTWr1HZhz9s6w for ; Thu, 20 Jun 2019 01:34:16 +1000 (AEST) Received: from localhost ([::1]:39502 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdcbG-00032P-2A for incoming@patchwork.ozlabs.org; Wed, 19 Jun 2019 11:34:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42524) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdcTy-0003Ln-Kh for qemu-devel@nongnu.org; Wed, 19 Jun 2019 11:26:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdcTx-0002Dg-Hq for qemu-devel@nongnu.org; Wed, 19 Jun 2019 11:26:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46356) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hdcTv-0002BR-4s; Wed, 19 Jun 2019 11:26:39 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4BEB8305E237; Wed, 19 Jun 2019 15:26:33 +0000 (UTC) Received: from localhost (ovpn-116-121.ams2.redhat.com [10.36.116.121]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 82841608C2; Wed, 19 Jun 2019 15:26:29 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Wed, 19 Jun 2019 17:26:01 +0200 Message-Id: <20190619152603.5937-8-mreitz@redhat.com> In-Reply-To: <20190619152603.5937-1-mreitz@redhat.com> References: <20190619152603.5937-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 19 Jun 2019 15:26:33 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 7/9] block: Fix BDS children's .drained_end() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi , Max Reitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" BdrvChildRole.drained_end() must not poll, bdrv_child_cb_drained_end() should use bdrv_drained_end_no_poll() instead of bdrv_drained_end(). The existing implementation works perfectly well for .drained_end_unquiesce(), though, so use it there. Signed-off-by: Max Reitz --- block.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/block.c b/block.c index 31b85df0f0..1652f3d29b 100644 --- a/block.c +++ b/block.c @@ -912,6 +912,12 @@ static bool bdrv_child_cb_drained_poll(BdrvChild *child) } static void bdrv_child_cb_drained_end(BdrvChild *child) +{ + BlockDriverState *bs = child->opaque; + bdrv_drained_end_no_poll(bs); +} + +static void bdrv_child_cb_drained_end_unquiesce(BdrvChild *child) { BlockDriverState *bs = child->opaque; bdrv_drained_end(bs); @@ -1014,6 +1020,7 @@ const BdrvChildRole child_file = { .drained_begin = bdrv_child_cb_drained_begin, .drained_poll = bdrv_child_cb_drained_poll, .drained_end = bdrv_child_cb_drained_end, + .drained_end_unquiesce = bdrv_child_cb_drained_end_unquiesce, .attach = bdrv_child_cb_attach, .detach = bdrv_child_cb_detach, .inactivate = bdrv_child_cb_inactivate, @@ -1042,6 +1049,7 @@ const BdrvChildRole child_format = { .drained_begin = bdrv_child_cb_drained_begin, .drained_poll = bdrv_child_cb_drained_poll, .drained_end = bdrv_child_cb_drained_end, + .drained_end_unquiesce = bdrv_child_cb_drained_end_unquiesce, .attach = bdrv_child_cb_attach, .detach = bdrv_child_cb_detach, .inactivate = bdrv_child_cb_inactivate, @@ -1168,6 +1176,7 @@ const BdrvChildRole child_backing = { .drained_begin = bdrv_child_cb_drained_begin, .drained_poll = bdrv_child_cb_drained_poll, .drained_end = bdrv_child_cb_drained_end, + .drained_end_unquiesce = bdrv_child_cb_drained_end_unquiesce, .inactivate = bdrv_child_cb_inactivate, .update_filename = bdrv_backing_update_filename, .can_set_aio_ctx = bdrv_child_cb_can_set_aio_ctx,