From nobody Tue Nov 11 05:10:41 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1560958145; cv=none; d=zoho.com; s=zohoarc; b=KLU0MaeRzL3zXQYO5+LDnovRh/ZKG6zBK+JaGQCYA7yBEYCQplaNQTMR7KWWTWBHEHXYR0zO/5OnuVnm347oqj/kHw9V0YkqSBc4vl6M6t4qQpVf4Bowb2fiwsanz9iL5b2aBZy06Ft21IPeU2uzFkelCVHBbiDpzK6jeKttW7A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560958145; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=QpreHFkQ8oYgQvNkkmxmzRAx7yQDB+Q4Ws+gbT6NTz8=; b=fOrDDAyXuj6d5q+lNI5jgF0YhatHUOcYIUhobIpwWrGsWp4FtIUuPmViZj0ZIIMXyLlP+BGmBNCuKco8Qgl1uNwmjGmyjSk3lS+Sj4YVTcTrr7LHR3y/kM1VurRwtgikQqaBvq81P0VyV2C1A0qtyVR6HDFNY4l7ixipsuwcsSw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560958145169860.5317501426562; Wed, 19 Jun 2019 08:29:05 -0700 (PDT) Received: from localhost ([::1]:39410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdcWG-0005WX-5z for importer@patchew.org; Wed, 19 Jun 2019 11:29:04 -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) Content-Transfer-Encoding: quoted-printable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" 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); =20 +/** + * 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); } =20 +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); --=20 2.21.0