From patchwork Wed Jun 19 15:26:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Reitz X-Patchwork-Id: 11004499 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC85E76 for ; Wed, 19 Jun 2019 15:28:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD0D22847B for ; Wed, 19 Jun 2019 15:28:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A13F628C0D; Wed, 19 Jun 2019 15:28:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3CB2628BFC for ; Wed, 19 Jun 2019 15:28:26 +0000 (UTC) Received: from localhost ([::1]:39410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdcVd-0005WX-Hp for patchwork-qemu-devel@patchwork.kernel.org; Wed, 19 Jun 2019 11:28:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42463) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdcTw-0003GA-43 for qemu-devel@nongnu.org; Wed, 19 Jun 2019 11:26:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdcTv-0002Bq-3u for qemu-devel@nongnu.org; Wed, 19 Jun 2019 11:26:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58844) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hdcTs-00024W-Oy; Wed, 19 Jun 2019 11:26:36 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C27AE81DE1; Wed, 19 Jun 2019 15:26:27 +0000 (UTC) Received: from localhost (ovpn-116-121.ams2.redhat.com [10.36.116.121]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 643CB60FAB; Wed, 19 Jun 2019 15:26:27 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Wed, 19 Jun 2019 17:26:00 +0200 Message-Id: <20190619152603.5937-7-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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 19 Jun 2019 15:26:27 +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 6/9] block: Add bdrv_drained_end_no_poll() 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP In contrast to bdrv_drained_end(), which does poll and may thus lead to graph changes, this new interface to bdrv_do_drained_end() will not poll. Signed-off-by: Max Reitz --- include/block/block.h | 12 +++++++++++- block/io.c | 5 +++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/block/block.h b/include/block/block.h index d98237f0f1..422448d773 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -680,10 +680,20 @@ void bdrv_subtree_drained_begin(BlockDriverState *bs); /** * bdrv_drained_end: * - * End a quiescent section started by bdrv_drained_begin(). + * End a quiescent section started by bdrv_drained_begin(). This may + * result in block graph changes. */ void bdrv_drained_end(BlockDriverState *bs); +/** + * bdrv_drained_end_no_poll: + * + * Same as bdrv_drained_end(), but do not poll for the subgraph to + * actually become unquiesced. Therefore, no graph changes will occur + * with this function. + */ +void bdrv_drained_end_no_poll(BlockDriverState *bs); + /** * End a quiescent section started by bdrv_subtree_drained_begin(). */ diff --git a/block/io.c b/block/io.c index 5f30baa8e5..188dea22bc 100644 --- a/block/io.c +++ b/block/io.c @@ -539,6 +539,11 @@ void bdrv_drained_end(BlockDriverState *bs) bdrv_do_drained_end(bs, false, NULL, false, true, NULL); } +void bdrv_drained_end_no_poll(BlockDriverState *bs) +{ + bdrv_do_drained_end(bs, false, NULL, false, false, NULL); +} + void bdrv_subtree_drained_end(BlockDriverState *bs) { bdrv_do_drained_end(bs, true, NULL, false, true, NULL);