From nobody Mon Apr 29 06:42:58 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) 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 151248583979115.143361444502716; Tue, 5 Dec 2017 06:57:19 -0800 (PST) Received: from localhost ([::1]:49244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMEep-0002vc-KG for importer@patchew.org; Tue, 05 Dec 2017 09:57:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMEcY-0001Dc-HG for qemu-devel@nongnu.org; Tue, 05 Dec 2017 09:54:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eMEcU-0005XZ-Kk for qemu-devel@nongnu.org; Tue, 05 Dec 2017 09:54:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41662) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eMEcL-0005Ui-Ad; Tue, 05 Dec 2017 09:54:41 -0500 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 6261FC01A69E; Tue, 5 Dec 2017 14:54:40 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-104.ams2.redhat.com [10.36.117.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F45E5C661; Tue, 5 Dec 2017 14:54:38 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 5 Dec 2017 15:54:21 +0100 Message-Id: <20171205145424.24598-2-kwolf@redhat.com> In-Reply-To: <20171205145424.24598-1-kwolf@redhat.com> References: <20171205145424.24598-1-kwolf@redhat.com> 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.31]); Tue, 05 Dec 2017 14:54:40 +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 1/4] block: Make bdrv_drain_invoke() recursive 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, qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This change separates bdrv_drain_invoke(), which calls the BlockDriver drain callbacks, from bdrv_drain_recurse(). Instead, the function performs its own recursion now. One reason for this is that bdrv_drain_recurse() can be called multiple times bdrv_drain_recurse(), but the callbacks may only be called once. The separation is necessary to fix this bug. The other reasons is that we intend to go to model where we call all driver callbacks first, and only then start polling. This is not fully achieved yet with this patch, as bdrv_drain_invoke() contains a BDRV_POLL_WHILE() loop for the block driver callbacks which can still call callbacks for any unrelated event. It's a step in this direction anyway. Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf --- block/io.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/block/io.c b/block/io.c index 6773926fc1..096468b761 100644 --- a/block/io.c +++ b/block/io.c @@ -175,8 +175,10 @@ static void coroutine_fn bdrv_drain_invoke_entry(void = *opaque) bdrv_wakeup(bs); } =20 +/* Recursively call BlockDriver.bdrv_co_drain_begin/end callbacks */ static void bdrv_drain_invoke(BlockDriverState *bs, bool begin) { + BdrvChild *child, *tmp; BdrvCoDrainData data =3D { .bs =3D bs, .done =3D false, .begin =3D beg= in}; =20 if (!bs->drv || (begin && !bs->drv->bdrv_co_drain_begin) || @@ -187,6 +189,10 @@ static void bdrv_drain_invoke(BlockDriverState *bs, bo= ol begin) data.co =3D qemu_coroutine_create(bdrv_drain_invoke_entry, &data); bdrv_coroutine_enter(bs, data.co); BDRV_POLL_WHILE(bs, !data.done); + + QLIST_FOREACH_SAFE(child, &bs->children, next, tmp) { + bdrv_drain_invoke(child->bs, begin); + } } =20 static bool bdrv_drain_recurse(BlockDriverState *bs, bool begin) @@ -194,9 +200,6 @@ static bool bdrv_drain_recurse(BlockDriverState *bs, bo= ol begin) BdrvChild *child, *tmp; bool waited; =20 - /* Ensure any pending metadata writes are submitted to bs->file. */ - bdrv_drain_invoke(bs, begin); - /* Wait for drained requests to finish */ waited =3D BDRV_POLL_WHILE(bs, atomic_read(&bs->in_flight) > 0); =20 @@ -279,6 +282,7 @@ void bdrv_drained_begin(BlockDriverState *bs) bdrv_parent_drained_begin(bs); } =20 + bdrv_drain_invoke(bs, true); bdrv_drain_recurse(bs, true); } =20 @@ -294,6 +298,7 @@ void bdrv_drained_end(BlockDriverState *bs) } =20 bdrv_parent_drained_end(bs); + bdrv_drain_invoke(bs, false); bdrv_drain_recurse(bs, false); aio_enable_external(bdrv_get_aio_context(bs)); } @@ -372,6 +377,8 @@ void bdrv_drain_all_begin(void) aio_context_acquire(aio_context); for (bs =3D bdrv_first(&it); bs; bs =3D bdrv_next(&it)) { if (aio_context =3D=3D bdrv_get_aio_context(bs)) { + /* FIXME Calling this multiple times is wrong */ + bdrv_drain_invoke(bs, true); waited |=3D bdrv_drain_recurse(bs, true); } } @@ -393,6 +400,7 @@ void bdrv_drain_all_end(void) aio_context_acquire(aio_context); aio_enable_external(aio_context); bdrv_parent_drained_end(bs); + bdrv_drain_invoke(bs, false); bdrv_drain_recurse(bs, false); aio_context_release(aio_context); } --=20 2.13.6 From nobody Mon Apr 29 06:42:58 2024 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 151248592181576.54442322441344; Tue, 5 Dec 2017 06:58:41 -0800 (PST) Received: from localhost ([::1]:49254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMEfy-0005Bs-Ua for importer@patchew.org; Tue, 05 Dec 2017 09:58:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMEcQ-000186-DV for qemu-devel@nongnu.org; Tue, 05 Dec 2017 09:54:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eMEcP-0005W7-HM for qemu-devel@nongnu.org; Tue, 05 Dec 2017 09:54:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37636) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eMEcN-0005V9-B7; Tue, 05 Dec 2017 09:54:43 -0500 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 548A729A56; Tue, 5 Dec 2017 14:54:42 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-104.ams2.redhat.com [10.36.117.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id AE8045C661; Tue, 5 Dec 2017 14:54:40 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 5 Dec 2017 15:54:22 +0100 Message-Id: <20171205145424.24598-3-kwolf@redhat.com> In-Reply-To: <20171205145424.24598-1-kwolf@redhat.com> References: <20171205145424.24598-1-kwolf@redhat.com> 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.28]); Tue, 05 Dec 2017 14:54:42 +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 2/4] block: Call .drain_begin only once in bdrv_drain_all_begin() 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, qemu-stable@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" bdrv_drain_all_begin() used to call the .bdrv_co_drain_begin() driver callback inside its polling loop. This means that how many times it got called for each node depended on long it had to poll the event loop. This is obviously not right and results in nodes that stay drained even after bdrv_drain_all_end(), which calls .bdrv_co_drain_begin() once per node. Fix bdrv_drain_all_begin() to call the callback only once, too. Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf --- block/io.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/io.c b/block/io.c index 096468b761..603f5b059e 100644 --- a/block/io.c +++ b/block/io.c @@ -355,6 +355,7 @@ void bdrv_drain_all_begin(void) aio_context_acquire(aio_context); bdrv_parent_drained_begin(bs); aio_disable_external(aio_context); + bdrv_drain_invoke(bs, true); aio_context_release(aio_context); =20 if (!g_slist_find(aio_ctxs, aio_context)) { @@ -377,8 +378,6 @@ void bdrv_drain_all_begin(void) aio_context_acquire(aio_context); for (bs =3D bdrv_first(&it); bs; bs =3D bdrv_next(&it)) { if (aio_context =3D=3D bdrv_get_aio_context(bs)) { - /* FIXME Calling this multiple times is wrong */ - bdrv_drain_invoke(bs, true); waited |=3D bdrv_drain_recurse(bs, true); } } --=20 2.13.6 From nobody Mon Apr 29 06:42:58 2024 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 1512485971620688.4950003291435; Tue, 5 Dec 2017 06:59:31 -0800 (PST) Received: from localhost ([::1]:49258 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMEgv-0005yy-Oj for importer@patchew.org; Tue, 05 Dec 2017 09:59:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMEca-0001Fm-Jf for qemu-devel@nongnu.org; Tue, 05 Dec 2017 09:54:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eMEcZ-0005Ys-4W for qemu-devel@nongnu.org; Tue, 05 Dec 2017 09:54:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54765) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eMEcP-0005Vs-Ok; Tue, 05 Dec 2017 09:54:45 -0500 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 C963D7EA97; Tue, 5 Dec 2017 14:54:44 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-104.ams2.redhat.com [10.36.117.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id A7D737838A; Tue, 5 Dec 2017 14:54:42 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 5 Dec 2017 15:54:23 +0100 Message-Id: <20171205145424.24598-4-kwolf@redhat.com> In-Reply-To: <20171205145424.24598-1-kwolf@redhat.com> References: <20171205145424.24598-1-kwolf@redhat.com> 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.28]); Tue, 05 Dec 2017 14:54:44 +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 3/4] test-bdrv-drain: Test BlockDriver callbacks for drain 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, qemu-stable@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" This adds a test case that the BlockDriver callbacks for drain are called in bdrv_drained_all_begin/end(), and that both of them are called exactly once. Signed-off-by: Kevin Wolf --- tests/test-bdrv-drain.c | 137 ++++++++++++++++++++++++++++++++++++++++++++= ++++ tests/Makefile.include | 2 + 2 files changed, 139 insertions(+) create mode 100644 tests/test-bdrv-drain.c diff --git a/tests/test-bdrv-drain.c b/tests/test-bdrv-drain.c new file mode 100644 index 0000000000..67541438c1 --- /dev/null +++ b/tests/test-bdrv-drain.c @@ -0,0 +1,137 @@ +/* + * Block node draining tests + * + * Copyright (c) 2017 Kevin Wolf + * + * Permission is hereby granted, free of charge, to any person obtaining a= copy + * of this software and associated documentation files (the "Software"), t= o deal + * in the Software without restriction, including without limitation the r= ights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included= in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN + * THE SOFTWARE. + */ + +#include "qemu/osdep.h" +#include "block/block.h" +#include "sysemu/block-backend.h" +#include "qapi/error.h" + +typedef struct BDRVTestState { + int drain_count; +} BDRVTestState; + +static void coroutine_fn bdrv_test_co_drain_begin(BlockDriverState *bs) +{ + BDRVTestState *s =3D bs->opaque; + s->drain_count++; +} + +static void coroutine_fn bdrv_test_co_drain_end(BlockDriverState *bs) +{ + BDRVTestState *s =3D bs->opaque; + s->drain_count--; +} + +static void bdrv_test_close(BlockDriverState *bs) +{ + BDRVTestState *s =3D bs->opaque; + g_assert_cmpint(s->drain_count, >, 0); +} + +static int coroutine_fn bdrv_test_co_preadv(BlockDriverState *bs, + uint64_t offset, uint64_t byte= s, + QEMUIOVector *qiov, int flags) +{ + /* We want this request to stay until the polling loop in drain waits = for + * it to complete. We need to sleep a while as bdrv_drain_invoke() com= es + * first and polls its result, too, but it shouldn't accidentally comp= lete + * this request yet. */ + co_aio_sleep_ns(qemu_get_aio_context(), QEMU_CLOCK_REALTIME, 100000); + + return 0; +} + +static BlockDriver bdrv_test =3D { + .format_name =3D "test", + .instance_size =3D sizeof(BDRVTestState), + + .bdrv_close =3D bdrv_test_close, + .bdrv_co_preadv =3D bdrv_test_co_preadv, + + .bdrv_co_drain_begin =3D bdrv_test_co_drain_begin, + .bdrv_co_drain_end =3D bdrv_test_co_drain_end, +}; + +static void aio_ret_cb(void *opaque, int ret) +{ + int *aio_ret =3D opaque; + *aio_ret =3D ret; +} + +static void test_drv_cb_drain_all(void) +{ + BlockBackend *blk; + BlockDriverState *bs; + BDRVTestState *s; + BlockAIOCB *acb; + int aio_ret; + + QEMUIOVector qiov; + struct iovec iov =3D { + .iov_base =3D NULL, + .iov_len =3D 0, + }; + qemu_iovec_init_external(&qiov, &iov, 1); + + blk =3D blk_new(BLK_PERM_ALL, BLK_PERM_ALL); + bs =3D bdrv_new_open_driver(&bdrv_test, "test-node", BDRV_O_RDWR, + &error_abort); + s =3D bs->opaque; + blk_insert_bs(blk, bs, &error_abort); + + /* Simple bdrv_drain_all_begin/end pair, check that CBs are called */ + g_assert_cmpint(s->drain_count, =3D=3D, 0); + bdrv_drain_all_begin(); + g_assert_cmpint(s->drain_count, =3D=3D, 1); + bdrv_drain_all_end(); + g_assert_cmpint(s->drain_count, =3D=3D, 0); + + /* Now do the same while a request is pending */ + aio_ret =3D -EINPROGRESS; + acb =3D blk_aio_preadv(blk, 0, &qiov, 0, aio_ret_cb, &aio_ret); + g_assert(acb !=3D NULL); + g_assert_cmpint(aio_ret, =3D=3D, -EINPROGRESS); + + g_assert_cmpint(s->drain_count, =3D=3D, 0); + bdrv_drain_all_begin(); + g_assert_cmpint(aio_ret, =3D=3D, 0); + g_assert_cmpint(s->drain_count, =3D=3D, 1); + bdrv_drain_all_end(); + g_assert_cmpint(s->drain_count, =3D=3D, 0); + + bdrv_unref(bs); + blk_unref(blk); +} + +int main(int argc, char **argv) +{ + bdrv_init(); + qemu_init_main_loop(&error_abort); + + g_test_init(&argc, &argv, NULL); + + g_test_add_func("/bdrv-drain/driver-cb/drain_all", test_drv_cb_drain_a= ll); + + return g_test_run(); +} diff --git a/tests/Makefile.include b/tests/Makefile.include index c002352134..c29db7616f 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -80,6 +80,7 @@ gcov-files-test-thread-pool-y =3D thread-pool.c gcov-files-test-hbitmap-y =3D util/hbitmap.c check-unit-y +=3D tests/test-hbitmap$(EXESUF) gcov-files-test-hbitmap-y =3D blockjob.c +check-unit-y +=3D tests/test-bdrv-drain$(EXESUF) check-unit-y +=3D tests/test-blockjob$(EXESUF) check-unit-y +=3D tests/test-blockjob-txn$(EXESUF) check-unit-y +=3D tests/test-x86-cpuid$(EXESUF) @@ -592,6 +593,7 @@ tests/test-coroutine$(EXESUF): tests/test-coroutine.o $= (test-block-obj-y) tests/test-aio$(EXESUF): tests/test-aio.o $(test-block-obj-y) tests/test-aio-multithread$(EXESUF): tests/test-aio-multithread.o $(test-b= lock-obj-y) tests/test-throttle$(EXESUF): tests/test-throttle.o $(test-block-obj-y) +tests/test-bdrv-drain$(EXESUF): tests/test-bdrv-drain.o $(test-block-obj-y= ) $(test-util-obj-y) tests/test-blockjob$(EXESUF): tests/test-blockjob.o $(test-block-obj-y) $(= test-util-obj-y) tests/test-blockjob-txn$(EXESUF): tests/test-blockjob-txn.o $(test-block-o= bj-y) $(test-util-obj-y) tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(test-block-obj= -y) --=20 2.13.6 From nobody Mon Apr 29 06:42:58 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) 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 1512485855605230.51802074018542; Tue, 5 Dec 2017 06:57:35 -0800 (PST) Received: from localhost ([::1]:49245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMEet-0002yV-Eh for importer@patchew.org; Tue, 05 Dec 2017 09:57:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41351) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMEcb-0001Gy-Rh for qemu-devel@nongnu.org; Tue, 05 Dec 2017 09:54:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eMEcZ-0005ZS-RC for qemu-devel@nongnu.org; Tue, 05 Dec 2017 09:54:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50198) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eMEcS-0005Wo-KZ; Tue, 05 Dec 2017 09:54:48 -0500 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 A80D64E02B; Tue, 5 Dec 2017 14:54:47 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-104.ams2.redhat.com [10.36.117.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1F45D7836D; Tue, 5 Dec 2017 14:54:44 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 5 Dec 2017 15:54:24 +0100 Message-Id: <20171205145424.24598-5-kwolf@redhat.com> In-Reply-To: <20171205145424.24598-1-kwolf@redhat.com> References: <20171205145424.24598-1-kwolf@redhat.com> 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.38]); Tue, 05 Dec 2017 14:54:47 +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 4/4] block: bdrv_drain_recurse(): Remove unused begin parameter 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, qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Now that the bdrv_drain_invoke() calls are pulled up to the callers of bdrv_drain_recurse(), the 'begin' parameter isn't needed any more. Signed-off-by: Kevin Wolf --- block/io.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/block/io.c b/block/io.c index 603f5b059e..390d463c71 100644 --- a/block/io.c +++ b/block/io.c @@ -195,7 +195,7 @@ static void bdrv_drain_invoke(BlockDriverState *bs, boo= l begin) } } =20 -static bool bdrv_drain_recurse(BlockDriverState *bs, bool begin) +static bool bdrv_drain_recurse(BlockDriverState *bs) { BdrvChild *child, *tmp; bool waited; @@ -218,7 +218,7 @@ static bool bdrv_drain_recurse(BlockDriverState *bs, bo= ol begin) */ bdrv_ref(bs); } - waited |=3D bdrv_drain_recurse(bs, begin); + waited |=3D bdrv_drain_recurse(bs); if (in_main_loop) { bdrv_unref(bs); } @@ -283,7 +283,7 @@ void bdrv_drained_begin(BlockDriverState *bs) } =20 bdrv_drain_invoke(bs, true); - bdrv_drain_recurse(bs, true); + bdrv_drain_recurse(bs); } =20 void bdrv_drained_end(BlockDriverState *bs) @@ -299,7 +299,7 @@ void bdrv_drained_end(BlockDriverState *bs) =20 bdrv_parent_drained_end(bs); bdrv_drain_invoke(bs, false); - bdrv_drain_recurse(bs, false); + bdrv_drain_recurse(bs); aio_enable_external(bdrv_get_aio_context(bs)); } =20 @@ -378,7 +378,7 @@ void bdrv_drain_all_begin(void) aio_context_acquire(aio_context); for (bs =3D bdrv_first(&it); bs; bs =3D bdrv_next(&it)) { if (aio_context =3D=3D bdrv_get_aio_context(bs)) { - waited |=3D bdrv_drain_recurse(bs, true); + waited |=3D bdrv_drain_recurse(bs); } } aio_context_release(aio_context); @@ -400,7 +400,7 @@ void bdrv_drain_all_end(void) aio_enable_external(aio_context); bdrv_parent_drained_end(bs); bdrv_drain_invoke(bs, false); - bdrv_drain_recurse(bs, false); + bdrv_drain_recurse(bs); aio_context_release(aio_context); } =20 --=20 2.13.6