From nobody Sun Feb 8 18:19:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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=openvz.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 164925925980442.56601930340082; Wed, 6 Apr 2022 08:34:19 -0700 (PDT) Received: from localhost ([::1]:47062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nc7fm-00031r-Mq for importer@patchew.org; Wed, 06 Apr 2022 11:34:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nc7ds-0000uR-Q2 for qemu-devel@nongnu.org; Wed, 06 Apr 2022 11:32:21 -0400 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]:46598) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nc7dp-0001te-S6 for qemu-devel@nongnu.org; Wed, 06 Apr 2022 11:32:20 -0400 Received: by mail-lf1-x12b.google.com with SMTP id e16so4683830lfc.13 for ; Wed, 06 Apr 2022 08:32:17 -0700 (PDT) Received: from fedora.. ([185.215.60.161]) by smtp.gmail.com with ESMTPSA id m20-20020a056512115400b0044aa2184999sm1861378lfg.142.2022.04.06.08.32.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 08:32:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+YbsXez79aBIQBvhfLmRW92p3RKZFT5OA9WKYM7VT1w=; b=l9Z652iWepGrrlJErYgWHQi/wC838YoB1Y19MekUDofe6GxRoGvfmTxhW0u+9Bp8K0 Fjq1ca/WdpSf/jitGu42cfTNIUD4uGoKdNgf0Ye48fvMoIKhgE6JntzzTbm0tXf2MHRE m978u5VCJ0iDZPfWYhFc3RwUQpXFnwiwHHnjS8kgbtcgHPVvMj0dpOGkNXo/p4wG1PVP xiicjVupybTQviWOqkl6wFpHVc1Y6jEIL9z+KEjbHFZ4yjlN4maBC7hFOgAf/TrLit3u EIXBCK/hk7DlXf96q1ybDVczK5kezSTCH9xPzoHG9ZHMWcT9Bwjn5rYrTPozZfh74hAe ZAdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+YbsXez79aBIQBvhfLmRW92p3RKZFT5OA9WKYM7VT1w=; b=NcGnir4DGaluBarEAeBfRECc0Mx0BKDmbfYaMgjILMCSuqBci13Ewh2lu3Rlixe6Z3 oibf3gCe27j52T3FoEdgjc68vCDYTFxv3RTm4jWx7ahj3QN/QSCMuM0vhudSQU+Aq4xd 7urHun4CoFxFdH/5htNW1Ej1Ba9ZOyQXt7+tsNH0LPVebUN5WziNeprz2iHQ0c0S+Wj7 GwB3VnPRJjeDn44Ag+5h7FQSsRnxTnsZAe9z1nrOzv6sOw4SPBkD3yUZvJ5F5YZhbMID HNXdC5p+W6cICDv7F2fTIPqlE4E32cfmhT8KSouOQC4OTplOCpmQkkaR3wu9Ea/UhS2+ A93g== X-Gm-Message-State: AOAM531WMIqijPzvbzHb5eXXkzL3hNi3i7f9kJuiDFQllhXt8HNAGhjC QrXiowratxo424ZAMJhCUO1GLA== X-Google-Smtp-Source: ABdhPJwYAOxSv5dQjd1e4i1YOp7QmsDGFuFz6GSsTeUMOyf1lUD8RfYJ6m/th/7Jn/Rmd1MwT0mxqQ== X-Received: by 2002:a05:6512:b1b:b0:44a:9ae9:b9bf with SMTP id w27-20020a0565120b1b00b0044a9ae9b9bfmr6275935lfu.365.1649259135946; Wed, 06 Apr 2022 08:32:15 -0700 (PDT) From: Vladimir Sementsov-Ogievskiy X-Google-Original-From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH 1/2] block/throttle-groups: use QEMU_CLOCK_REALTIME for qtest too Date: Wed, 6 Apr 2022 18:32:01 +0300 Message-Id: <20220406153202.332186-2-vsementsov@openvz.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220406153202.332186-1-vsementsov@openvz.org> References: <20220406153202.332186-1-vsementsov@openvz.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=vladimir.sementsov-ogievskiy@openvz.org; helo=mail-lf1-x12b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, v.sementsov-og@mail.ru, berto@igalia.com, qemu-devel@nongnu.org, hreitz@redhat.com, vsementsov@openvz.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1649259262463100001 Content-Type: text/plain; charset="utf-8" Virtual clock just doesn't tick for iotests, and throttling just not work. Let's use realtime clock. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/throttle-groups.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/block/throttle-groups.c b/block/throttle-groups.c index fb203c3ced..029158d797 100644 --- a/block/throttle-groups.c +++ b/block/throttle-groups.c @@ -753,10 +753,6 @@ static void throttle_group_obj_init(Object *obj) ThrottleGroup *tg =3D THROTTLE_GROUP(obj); =20 tg->clock_type =3D QEMU_CLOCK_REALTIME; - if (qtest_enabled()) { - /* For testing block IO throttling only */ - tg->clock_type =3D QEMU_CLOCK_VIRTUAL; - } tg->is_initialized =3D false; qemu_mutex_init(&tg->lock); throttle_init(&tg->ts); --=20 2.35.1 From nobody Sun Feb 8 18:19:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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=openvz.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1649259280020166.27313105257167; Wed, 6 Apr 2022 08:34:40 -0700 (PDT) Received: from localhost ([::1]:48090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nc7g7-0003ix-2R for importer@patchew.org; Wed, 06 Apr 2022 11:34:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nc7dt-0000uT-1b for qemu-devel@nongnu.org; Wed, 06 Apr 2022 11:32:21 -0400 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]:43750) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nc7dq-0001tm-6z for qemu-devel@nongnu.org; Wed, 06 Apr 2022 11:32:20 -0400 Received: by mail-lf1-x12e.google.com with SMTP id z12so4710617lfu.10 for ; Wed, 06 Apr 2022 08:32:17 -0700 (PDT) Received: from fedora.. ([185.215.60.161]) by smtp.gmail.com with ESMTPSA id m20-20020a056512115400b0044aa2184999sm1861378lfg.142.2022.04.06.08.32.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 08:32:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YdmnKAbX7LBd9yV1jKELlDUOSLpTg0se5H4/OG6SDPM=; b=E3i1ouyIwUDUKjbbUql5RvLsUlTFLDEPsVo3wjmm7vmc5wKr+w+MveB7XLBphHYWP1 1abEkURnVE02/xNGNHYbkF7QrlEHY+bizKx6vmHRnKlRU2Tf7vcjkJbdJK2MzS4Y0D1V tBZ+0kS4FoBZDvKbid+XXzUBAI5REXoNA+ZRp940TaXRvlRktnmg5wfL0EEQfIxCnsyL ub3Tb9ZFcGLu+BY3oVKWEsTUZkxXfGVKe9wvqSaQ0qVlGruGFxf0gz/buQCvregwoamT /+P1Ge1TedG1xfmV7DHOZF0oXkZm6sGVkAXfpzgLjkJgC6KM7M1rGdXtCmzPFwGgfqtQ bdxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YdmnKAbX7LBd9yV1jKELlDUOSLpTg0se5H4/OG6SDPM=; b=LKDdtu2oPDHLUPPHQ1bVDT+jW9Cmq1A2+O8j3hmbZTZNBvi9jkQIb1NiGTjhZqa4ly sbXJ9Mv9BAjkASE8MWR61pNvof/3RqA8FZDv50cR9omGf/1rPmCfnMHhb6DAvia2Ag+Z FzQ06LV7u8WGUdBPlbdkFmLd1+FDIti0ia93LEB8uEgq0X/cYFri6IdwPDOTN5gJaAKd FgcjmcbRRzxt1CjQPfWpw3S7G9e3Xmi+yKTY/oR4zzSa/F2sssBN1PIHd8w+UgHqZab/ gjuIzqjRXx3q1uJupwbY6moH84IF4HoUL2FPJP10HxV4RPDt9KAy41ECp3R7FwHtKB15 MT/g== X-Gm-Message-State: AOAM531tb8oAqqsrLhU/TW4i0ERj3yqZXtQ5Ay7OqcmOOEJpoOIZSMAP cdVCYrZufjPglZt5I8R3IN8bbQ== X-Google-Smtp-Source: ABdhPJyw49dR7EewgmFV9iCFKzEC2emO2VgsXnwvNKf/fVnhYiJ7hh/MACkWfOJjPZuU6AXLQpzC6g== X-Received: by 2002:a05:6512:31d2:b0:44a:9ae9:edad with SMTP id j18-20020a05651231d200b0044a9ae9edadmr6183424lfe.513.1649259136571; Wed, 06 Apr 2022 08:32:16 -0700 (PDT) From: Vladimir Sementsov-Ogievskiy X-Google-Original-From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH 2/2] iotests: add throttle test Date: Wed, 6 Apr 2022 18:32:02 +0300 Message-Id: <20220406153202.332186-3-vsementsov@openvz.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220406153202.332186-1-vsementsov@openvz.org> References: <20220406153202.332186-1-vsementsov@openvz.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=vladimir.sementsov-ogievskiy@openvz.org; helo=mail-lf1-x12e.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, v.sementsov-og@mail.ru, berto@igalia.com, qemu-devel@nongnu.org, hreitz@redhat.com, vsementsov@openvz.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1649259283259100001 Content-Type: text/plain; charset="utf-8" Add simple test for throttle filter driver. Without previous "block/throttle-groups: use QEMU_CLOCK_REALTIME for qtest too" commit the test hangs forever, because previously used VIRTUAL clock just doesn't tick for iotests. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/tests/throttle | 50 +++++++++++++++++++++++++++ tests/qemu-iotests/tests/throttle.out | 0 2 files changed, 50 insertions(+) create mode 100755 tests/qemu-iotests/tests/throttle create mode 100644 tests/qemu-iotests/tests/throttle.out diff --git a/tests/qemu-iotests/tests/throttle b/tests/qemu-iotests/tests/t= hrottle new file mode 100755 index 0000000000..63b802cee7 --- /dev/null +++ b/tests/qemu-iotests/tests/throttle @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 +# group: auto +# +# Simple test for throttle filter driver. +# +# Copyright (c) 2022 Virtuozzo International GmbH +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +import iotests + +with iotests.VM() as vm: + vm.launch() + + result =3D vm.qmp('object-add', { + 'qom-type': 'throttle-group', + 'id': 'group0', + 'limits': {'bps-write': 512 * 1024} + }) + assert result =3D=3D {'return': {}} + + result =3D vm.qmp('blockdev-add', { + 'node-name': 'throt', + 'driver': 'throttle', + 'throttle-group': 'group0', + 'file': { + 'driver': 'null-co', + 'size': 1024 * 1024 + } + }) + assert result =3D=3D {'return': {}} + + result =3D vm.hmp_qemu_io('throt', 'write 0 512K') + assert result =3D=3D {'return': ''} + + # We need second write to trigger throttling + result =3D vm.hmp_qemu_io('throt', 'write 512K 512K') + assert result =3D=3D {'return': ''} diff --git a/tests/qemu-iotests/tests/throttle.out b/tests/qemu-iotests/tes= ts/throttle.out new file mode 100644 index 0000000000..e69de29bb2 --=20 2.35.1