{"id":816267,"url":"http://patchwork.ozlabs.org/api/patches/816267/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170920102311.25736-4-el13635@mail.ntua.gr/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170920102311.25736-4-el13635@mail.ntua.gr>","list_archive_url":null,"date":"2017-09-20T10:23:11","name":"[3/3] block/throttle.c: add bdrv_co_drain_begin/end callbacks","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"bad1a123eea3cf614896c0b1bdc4b4c445af492d","submitter":{"id":71571,"url":"http://patchwork.ozlabs.org/api/people/71571/?format=json","name":"Manos Pitsidianakis","email":"el13635@mail.ntua.gr"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170920102311.25736-4-el13635@mail.ntua.gr/mbox/","series":[{"id":4124,"url":"http://patchwork.ozlabs.org/api/series/4124/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=4124","date":"2017-09-20T10:23:09","name":"add bdrv_co_drain_begin/end BlockDriver callbacks","version":1,"mbox":"http://patchwork.ozlabs.org/series/4124/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/816267/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/816267/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xy26t254Tz9s82\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 00:24:06 +1000 (AEST)","from localhost ([::1]:48426 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dufv2-0002cG-9x\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 10:24:04 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:41731)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <el13635@mail.ntua.gr>) id 1dufAV-00024W-Up\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 09:36:00 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <el13635@mail.ntua.gr>) id 1dufAQ-00010P-DN\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 09:35:59 -0400","from smtp1.ntua.gr ([2001:648:2000:de::183]:20570)\n\tby eggs.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <el13635@mail.ntua.gr>)\n\tid 1dufAO-0000sM-3Z; Wed, 20 Sep 2017 09:35:52 -0400","from mail.ntua.gr (carp0.noc.ntua.gr [147.102.222.60])\n\t(authenticated bits=0)\n\tby smtp1.ntua.gr (8.15.2/8.15.2) with ESMTPSA id v8KANPPB022779\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=NOT); Wed, 20 Sep 2017 13:23:25 +0300 (EEST)\n\t(envelope-from el13635@mail.ntua.gr)"],"X-Authentication-Warning":"smtp1.ntua.gr: Host carp0.noc.ntua.gr\n\t[147.102.222.60] claimed to be mail.ntua.gr","From":"Manos Pitsidianakis <el13635@mail.ntua.gr>","To":"qemu-devel <qemu-devel@nongnu.org>","Date":"Wed, 20 Sep 2017 13:23:11 +0300","Message-Id":"<20170920102311.25736-4-el13635@mail.ntua.gr>","X-Mailer":"git-send-email 2.11.0","In-Reply-To":"<20170920102311.25736-1-el13635@mail.ntua.gr>","References":"<20170920102311.25736-1-el13635@mail.ntua.gr>","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2001:648:2000:de::183","Subject":"[Qemu-devel] [PATCH 3/3] block/throttle.c: add\n\tbdrv_co_drain_begin/end callbacks","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>,\n\tStefan Hajnoczi <stefanha@redhat.com>,\n\tqemu-block <qemu-block@nongnu.org>, Max Reitz <mreitz@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"Signed-off-by: Manos Pitsidianakis <el13635@mail.ntua.gr>\n---\n block/throttle.c | 18 ++++++++++++++++++\n 1 file changed, 18 insertions(+)","diff":"diff --git a/block/throttle.c b/block/throttle.c\nindex 5bca76300f..833175ac77 100644\n--- a/block/throttle.c\n+++ b/block/throttle.c\n@@ -197,6 +197,21 @@ static bool throttle_recurse_is_first_non_filter(BlockDriverState *bs,\n     return bdrv_recurse_is_first_non_filter(bs->file->bs, candidate);\n }\n \n+static void coroutine_fn throttle_co_drain_begin(BlockDriverState *bs)\n+{\n+    ThrottleGroupMember *tgm = bs->opaque;\n+    if (atomic_fetch_inc(&tgm->io_limits_disabled) == 0) {\n+        throttle_group_restart_tgm(tgm);\n+    }\n+}\n+\n+static void coroutine_fn throttle_co_drain_end(BlockDriverState *bs)\n+{\n+    ThrottleGroupMember *tgm = bs->opaque;\n+    assert(tgm->io_limits_disabled);\n+    atomic_dec(&tgm->io_limits_disabled);\n+}\n+\n static BlockDriver bdrv_throttle = {\n     .format_name                        =   \"throttle\",\n     .protocol_name                      =   \"throttle\",\n@@ -226,6 +241,9 @@ static BlockDriver bdrv_throttle = {\n     .bdrv_reopen_abort                  =   throttle_reopen_abort,\n     .bdrv_co_get_block_status           =   bdrv_co_get_block_status_from_file,\n \n+    .bdrv_co_drain_begin                =   throttle_co_drain_begin,\n+    .bdrv_co_drain_end                  =   throttle_co_drain_end,\n+\n     .is_filter                          =   true,\n };\n \n","prefixes":["3/3"]}