From nobody Sun Feb 8 16:30:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513766394878386.19245879348034; Wed, 20 Dec 2017 02:39:54 -0800 (PST) Received: from localhost ([::1]:45189 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRbmn-0007tr-RK for importer@patchew.org; Wed, 20 Dec 2017 05:39:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39288) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRbiw-0004cz-RK for qemu-devel@nongnu.org; Wed, 20 Dec 2017 05:35:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRbiv-00054I-8a for qemu-devel@nongnu.org; Wed, 20 Dec 2017 05:35:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48330) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRbir-0004xb-O0; Wed, 20 Dec 2017 05:35:37 -0500 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 D0A4433F7C7; Wed, 20 Dec 2017 10:35:36 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-136.ams2.redhat.com [10.36.116.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 626D350337; Wed, 20 Dec 2017 10:35:35 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Wed, 20 Dec 2017 11:34:01 +0100 Message-Id: <20171220103412.13048-9-kwolf@redhat.com> In-Reply-To: <20171220103412.13048-1-kwolf@redhat.com> References: <20171220103412.13048-1-kwolf@redhat.com> 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.29]); Wed, 20 Dec 2017 10:35:36 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 08/19] block: Don't block_job_pause_all() in bdrv_drain_all() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, pbonzini@redhat.com, famz@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Block jobs are already paused using the BdrvChildRole drain callbacks, so we don't need an additionall block_job_pause_all() call. Signed-off-by: Kevin Wolf --- block/io.c | 4 ---- tests/test-bdrv-drain.c | 10 ++++------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/block/io.c b/block/io.c index 91a52e2d82..74d2e5278e 100644 --- a/block/io.c +++ b/block/io.c @@ -338,8 +338,6 @@ void bdrv_drain_all_begin(void) * context. */ assert(qemu_get_current_aio_context() =3D=3D qemu_get_aio_context()); =20 - block_job_pause_all(); - for (bs =3D bdrv_first(&it); bs; bs =3D bdrv_next(&it)) { AioContext *aio_context =3D bdrv_get_aio_context(bs); =20 @@ -395,8 +393,6 @@ void bdrv_drain_all_end(void) aio_enable_external(aio_context); aio_context_release(aio_context); } - - block_job_resume_all(); } =20 void bdrv_drain_all(void) diff --git a/tests/test-bdrv-drain.c b/tests/test-bdrv-drain.c index 019fe9074d..4571137928 100644 --- a/tests/test-bdrv-drain.c +++ b/tests/test-bdrv-drain.c @@ -284,9 +284,8 @@ static void test_blockjob_common(enum drain_type drain_= type) do_drain_begin(drain_type, src); =20 if (drain_type =3D=3D BDRV_DRAIN_ALL) { - /* bdrv_drain_all() drains both src and target, and involves an - * additional block_job_pause_all() */ - g_assert_cmpint(job->pause_count, =3D=3D, 3); + /* bdrv_drain_all() drains both src and target */ + g_assert_cmpint(job->pause_count, =3D=3D, 2); } else { g_assert_cmpint(job->pause_count, =3D=3D, 1); } @@ -303,9 +302,8 @@ static void test_blockjob_common(enum drain_type drain_= type) do_drain_begin(drain_type, target); =20 if (drain_type =3D=3D BDRV_DRAIN_ALL) { - /* bdrv_drain_all() drains both src and target, and involves an - * additional block_job_pause_all() */ - g_assert_cmpint(job->pause_count, =3D=3D, 3); + /* bdrv_drain_all() drains both src and target */ + g_assert_cmpint(job->pause_count, =3D=3D, 2); } else { g_assert_cmpint(job->pause_count, =3D=3D, 1); } --=20 2.13.6