From nobody Fri Apr 26 14:03:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1620116965; cv=pass; d=zohomail.com; s=zohoarc; b=NgCaUsmfN2hParbzwG5KRpGXIIRHA5W5xttUXMUXmjH5JyQq8tbd31kk/oc0SzfnsLdVVbLBT/NeJnxPjI4wbvH+arWvO7yUw4gzEKC+266a9D/mEWMZgZKfJn9+TglMC0isCHaAu1Vah9dz4hEVtJREp1XPo/wjhaAGVVyM54o= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620116965; h=Content-Type: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; bh=LmHB0lj8TabK4FS3vkmWqcWawAA1oj+0/hNte/Jhqaw=; b=Q1RW83Na8TXVq7ZG2x011xBPDJD/IpynQzPgIbMtWLP8GT6CWCqqTzSQiZ9J6kV7IG+o37ep6rhfElkVR8YRa6fGJaw46t4YQCcbxQQ9WcHfRQT7nKi6aNI/8vmFeUMPYA4sxfZocjGn2zhHuvudm5evBQbVO7912A/XaSH1I1E= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; 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; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine 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 1620116965238679.519122578193; Tue, 4 May 2021 01:29:25 -0700 (PDT) Received: from localhost ([::1]:58814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldqQm-000206-2D for importer@patchew.org; Tue, 04 May 2021 04:29:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldqNr-0007xw-FS; Tue, 04 May 2021 04:26:24 -0400 Received: from mail-db8eur05on2118.outbound.protection.outlook.com ([40.107.20.118]:10464 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldqNm-0007EP-Cx; Tue, 04 May 2021 04:26:21 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3381.eurprd08.prod.outlook.com (2603:10a6:20b:43::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.44; Tue, 4 May 2021 08:26:09 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4108.024; Tue, 4 May 2021 08:26:09 +0000 Received: from localhost.localdomain (185.215.60.251) by HE1P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.27 via Frontend Transport; Tue, 4 May 2021 08:26:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iLpSVULnTfX9FlnPOwm6CHILyc8O5rzti0UBeQmLPLmxPfAHDoeqVD/vSz4NKSIB8xO3s/qB/waviMH9kuStiUuQZes+cQIdrw84fv8hdEcq4NvzyQlvpOXjoaKEV22G600xtEfNfwUf3H6GikeviaPJScaJ6Ld0Xu4oGopsjIVxYuATXszZSiJ9Blb8Q1Aam7QDtnXaneH4he4HvaZSGm3iQgY6r41ozHpoXqtRDW8tYVZKjgPPIvzR6VafE8DmV1h0FU+L6mrXJdSiK/sL917r+4sFs8ZMYEl4GBVuYLS3TLAZ9Vy5peubbLrzvomvs0iE7VUpHytwhouO5OossQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LmHB0lj8TabK4FS3vkmWqcWawAA1oj+0/hNte/Jhqaw=; b=ceZtXJ7v+BvuHiTpDdHgPbIHICmc6Ag5kw4sdgJ8ASwwZTSoC5g2xBKkSTdPWvE5/H+XKRdjZAKi+sSgHGY86Im9cReYDRspvWwxkUa84grtPIVmNrUdYtVl+9Np2pccNk5w50KvMSgxFOXSgicBKcPCEEI5w+7egyWf4wteShEeIZcVMrCXidFoPvyjbs4ta6prBOrU1XFaOG4wh1Eam6bb8UO+3mH3gx+myr4Ybk616bdOQBCKIyGsASUR9s/jO9WoIivw0z3IVm44CxShEohrjRbfdr02WoRYYxc6eAgYcxsItKQunsepfjRBMMnAAb+N5/Cf7kWBbZxJlorLJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LmHB0lj8TabK4FS3vkmWqcWawAA1oj+0/hNte/Jhqaw=; b=OfhMKVRW7LwV6peugACNCTExrDd7EAefg3ZrLHzZhXnIgjmIVTISITsCdXH7MuhdQtDvAPP5UNocvx4V/7WUC2/oXWa9D3DIBMqcDZsPIp5xGU4URKSjliiOBSs0u1ic6eichXhGl46e0/7E7aADuIEhTgow25x3CFvBySiv94Q= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, fam@euphon.net, stefanha@redhat.com, mreitz@redhat.com, kwolf@redhat.com, vsementsov@virtuozzo.com, eesposit@redhat.com, pbonzini@redhat.com Subject: [PATCH v2 1/9] block/write-threshold: don't use write notifiers Date: Tue, 4 May 2021 11:25:45 +0300 Message-Id: <20210504082553.20377-2-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210504082553.20377-1-vsementsov@virtuozzo.com> References: <20210504082553.20377-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.251] X-ClientProxiedBy: HE1P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::23) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5320de76-e798-4700-89fd-08d90ed644c3 X-MS-TrafficTypeDiagnostic: AM6PR08MB3381: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ou7o9U3VtQFyA5fzY8EscaD2GNFWyCiWxPYwL954bLrB9jiQAdQ/YzIWM2XCSK8ectbVGKOAvwH0J6F1EuMHkJ661BDyRsDEUaqaxlJci4C/U6vJy7k3bD9xG0vUPZGBldhgkFNA6FR9U9EvUtCDiUiVypI36513TMbBrFaOLX3jL4QJEncEIWnAanE5d5kWboTvJbVLjH6LHW8lG6wcg9mUOvAAV1JgzBwv72+GbfTq5UNkq/83qkEKWntb+Oi4ZVdnG0i6DEnirhOnCJ2g8AKKceKdgeQydOXG45Zb/biwtgr2baRb3cQYRaSTS+aT9r0fL035qdOMp10ECqtoTpmtLHU65BtdNMzSdYZGbtdVs6fpG8UzVi7I3Dj5/j/RqsuEyOZYR0wt5ZUVXvAYfMZQVquLHoa3B6bBttItXCcKmNJHX55NH4AnIvVAID0SJwjmc+dffwOAWL0M7AFQYNQoE1V+4cgzsxYmify+NVylvvomDpOTonP70yL/GZ6JWjrFtNzJOgjBGengmsGOwyGyms5a8b8hqCqAK/ElFHt9KVGwTp0ALD0niuiGF3TmpbKECwNtOAceepvcF7gxJ6T+6qVk/NCGHXSFjFAgDpqE+1SvOKV7H+bDpo2JBYMDoR6CJE86SBWLcLJ3/fhCWqlItivTvUtNe5g4oTssTlGprTIe6fvBytUDgTESnz4V X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39830400003)(376002)(346002)(366004)(396003)(6666004)(83380400001)(38350700002)(38100700002)(5660300002)(8676002)(36756003)(16526019)(2616005)(186003)(956004)(1076003)(2906002)(316002)(4326008)(6506007)(478600001)(6486002)(26005)(8936002)(6916009)(6512007)(86362001)(66946007)(52116002)(66556008)(66476007)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?ovFvRi1YPAcuajgE8vpjx/w/v9Bs20IETYn1ZFkyaNyoDCGC9fVWWfivtQxy?= =?us-ascii?Q?UdvN/l5E0iTTdpyEBFZQ9pScnvP6fryWV5YklazFrStEnXmhRax3np6Lbt2Y?= =?us-ascii?Q?ORdpXFyGE1VjK4Sr2LQynxWFe255n3wRzyxne9k7/L16E+uWe5pgoy7cckGy?= =?us-ascii?Q?XT5R65luMVaOXfEtJJ/HQWEOxCbLfex7n0mnOvwTbcXYGJZpqwJvQPkzVr/c?= =?us-ascii?Q?iKDxPTqgyHJYiu9pPJfHC1aff/a8oUiXxBWF+Ju21aRhE1m30We4D8/F3mTr?= =?us-ascii?Q?y+p1Bvkepi0Dp6t5Webzj1qJQFsgPRj18G+fe8Wun/WeQFXJtb8XZGg+gCdb?= =?us-ascii?Q?mEMAjXTvhacljXvhn6EUujHvIQnWpd6MQQZ+gJLC8YjqWfI/oZFq3kTfx96d?= =?us-ascii?Q?8ZrgbcjTXGutgWuKeBw21vPVop9S7s0bC4FL3ea36w12uvyLKbqwKAKrNrcV?= =?us-ascii?Q?VllggpsCJSngz8AjIK/mrNOEHqxoCsdoq2t4bO1oF07ung9dmSUYColhvmS3?= =?us-ascii?Q?ZDh9kFTL3KtMofex64XTXh7Kft7aK4ngE07brn3hWq+5ZGpKXPLKhw0a/p2q?= =?us-ascii?Q?yspxkTuC8fMyqNcRoV0yxawzugPWRecM9LrFRtgHWps94TtR3JWtP0LGzqBN?= =?us-ascii?Q?9hhvqqF8noLFdb2onndi9QoL9MPq/04rogoSp6GOzFKL50pKZdjpPYcWibt5?= =?us-ascii?Q?RrQ2Aw8ku5qYvuqiG8dYwLW/1r4Haws8tF6RuswqQ89qLlP+T5ZZeqB3XXb1?= =?us-ascii?Q?LA5uNB8KNUHbO6rx7NVDI+FqXo7Llbghm0pKdSOFd35ld0LnIW+Zxaxk4EPI?= =?us-ascii?Q?sD9T9OPbDupoo1B1m9D2fT8ljeu7c7dMkLnSYTr9jODnfUjZ8S0zS1jHGT/T?= =?us-ascii?Q?DYSCbufzxaSdSqJluxtJa3lsl+zg8j8PJ/xD4otiFuzfkNJXf/HGYj5n5j27?= =?us-ascii?Q?i14n7diy8mkGVNFfQcMOifphWRqghJXHAXstWgT//qKAZAbUWWcg9kIl2SnJ?= =?us-ascii?Q?6y6DhbUILPdoL/dOjZd/edQ1wP6pZCBIaHDybiHqFrAgZixeVgWaJo2MDg2P?= =?us-ascii?Q?Eihe+UKdudH/+44P02m0GHPpwzvWf6TvL5ahUZ56mK4tKeLUN98pB9ide+HG?= =?us-ascii?Q?hz7IGUU6uBDjNgql9oHkfOe36yMZmRx9oyZI2xNzdyS4iHfQsr8npyxo01GD?= =?us-ascii?Q?bvCYwpyYk5k17VylV7vnvquw778n/c9IwRUL6SJcB6UFtuxPPAGGTD30bsHA?= =?us-ascii?Q?EBxaOP/3bPJBffe5IAcDTA3C/1v5wizR4fIqp3vuVK6Y2mUZwWae14OUtMO+?= =?us-ascii?Q?f+ezAR2Z/Iz4k3WuQHQYUyQX?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5320de76-e798-4700-89fd-08d90ed644c3 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2021 08:26:09.0465 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VRg7Argva3cqqVY4SO/29FIi0uVZWNa0Epi+aGhuBCgnWlSYW/9UacT+NhrrYgY3oyZ0PHie8ALnhQrfnoIQEebYgB26asipR93dPwD+aWg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3381 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=40.107.20.118; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" write-notifiers are used only for write-threshold. New code for such purpose should create filters. Let's better special-case write-threshold and drop write notifiers at all. (Actually, write-threshold is special-cased anyway, as the only user of write-notifiers) Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/block/block_int.h | 1 - include/block/write-threshold.h | 9 +++++ block/io.c | 5 ++- block/write-threshold.c | 68 +++++++-------------------------- 4 files changed, 25 insertions(+), 58 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index c823f5b1b3..51f51286a5 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -959,7 +959,6 @@ struct BlockDriverState { =20 /* threshold limit for writes, in bytes. "High water mark". */ uint64_t write_threshold_offset; - NotifierWithReturn write_threshold_notifier; =20 /* Writing to the list requires the BQL _and_ the dirty_bitmap_mutex. * Reading from the list can be done with either the BQL or the diff --git a/include/block/write-threshold.h b/include/block/write-threshol= d.h index c646f267a4..7942dcc368 100644 --- a/include/block/write-threshold.h +++ b/include/block/write-threshold.h @@ -59,4 +59,13 @@ bool bdrv_write_threshold_is_set(const BlockDriverState = *bs); uint64_t bdrv_write_threshold_exceeded(const BlockDriverState *bs, const BdrvTrackedRequest *req); =20 +/* + * bdrv_write_threshold_check_write + * + * Check, does specified request exceeds write threshold. If it is, send + * corresponding event and unset write threshold. + */ +void bdrv_write_threshold_check_write(BlockDriverState *bs, int64_t offset, + int64_t bytes); + #endif diff --git a/block/io.c b/block/io.c index 35b6c56efc..3520de51bb 100644 --- a/block/io.c +++ b/block/io.c @@ -30,6 +30,7 @@ #include "block/blockjob_int.h" #include "block/block_int.h" #include "block/coroutines.h" +#include "block/write-threshold.h" #include "qemu/cutils.h" #include "qapi/error.h" #include "qemu/error-report.h" @@ -2008,8 +2009,8 @@ bdrv_co_write_req_prepare(BdrvChild *child, int64_t o= ffset, int64_t bytes, } else { assert(child->perm & BLK_PERM_WRITE); } - return notifier_with_return_list_notify(&bs->before_write_notifier= s, - req); + bdrv_write_threshold_check_write(bs, offset, bytes); + return 0; case BDRV_TRACKED_TRUNCATE: assert(child->perm & BLK_PERM_RESIZE); return 0; diff --git a/block/write-threshold.c b/block/write-threshold.c index 85b78dc2a9..11152c60df 100644 --- a/block/write-threshold.c +++ b/block/write-threshold.c @@ -29,14 +29,6 @@ bool bdrv_write_threshold_is_set(const BlockDriverState = *bs) return bs->write_threshold_offset > 0; } =20 -static void write_threshold_disable(BlockDriverState *bs) -{ - if (bdrv_write_threshold_is_set(bs)) { - notifier_with_return_remove(&bs->write_threshold_notifier); - bs->write_threshold_offset =3D 0; - } -} - uint64_t bdrv_write_threshold_exceeded(const BlockDriverState *bs, const BdrvTrackedRequest *req) { @@ -51,55 +43,9 @@ uint64_t bdrv_write_threshold_exceeded(const BlockDriver= State *bs, return 0; } =20 -static int coroutine_fn before_write_notify(NotifierWithReturn *notifier, - void *opaque) -{ - BdrvTrackedRequest *req =3D opaque; - BlockDriverState *bs =3D req->bs; - uint64_t amount =3D 0; - - amount =3D bdrv_write_threshold_exceeded(bs, req); - if (amount > 0) { - qapi_event_send_block_write_threshold( - bs->node_name, - amount, - bs->write_threshold_offset); - - /* autodisable to avoid flooding the monitor */ - write_threshold_disable(bs); - } - - return 0; /* should always let other notifiers run */ -} - -static void write_threshold_register_notifier(BlockDriverState *bs) -{ - bs->write_threshold_notifier.notify =3D before_write_notify; - bdrv_add_before_write_notifier(bs, &bs->write_threshold_notifier); -} - -static void write_threshold_update(BlockDriverState *bs, - int64_t threshold_bytes) -{ - bs->write_threshold_offset =3D threshold_bytes; -} - void bdrv_write_threshold_set(BlockDriverState *bs, uint64_t threshold_byt= es) { - if (bdrv_write_threshold_is_set(bs)) { - if (threshold_bytes > 0) { - write_threshold_update(bs, threshold_bytes); - } else { - write_threshold_disable(bs); - } - } else { - if (threshold_bytes > 0) { - /* avoid multiple registration */ - write_threshold_register_notifier(bs); - write_threshold_update(bs, threshold_bytes); - } - /* discard bogus disable request */ - } + bs->write_threshold_offset =3D threshold_bytes; } =20 void qmp_block_set_write_threshold(const char *node_name, @@ -122,3 +68,15 @@ void qmp_block_set_write_threshold(const char *node_nam= e, =20 aio_context_release(aio_context); } + +void bdrv_write_threshold_check_write(BlockDriverState *bs, int64_t offset, + int64_t bytes) +{ + int64_t end =3D offset + bytes; + uint64_t wtr =3D bs->write_threshold_offset; + + if (wtr > 0 && end > wtr) { + qapi_event_send_block_write_threshold(bs->node_name, end - wtr, wt= r); + bdrv_write_threshold_set(bs, 0); + } +} --=20 2.29.2 From nobody Fri Apr 26 14:03:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1620117285; cv=pass; d=zohomail.com; s=zohoarc; b=ccHGwuGmFQjAcLlFyMDVG2l4KeVMoI1n1918fvCJkpxtZNN9TfrPYLwl/akudfiX1c6M8s5jVhL7URNyAeRVnDLFoi+pKakPEcl4BGuq03dMrWr4OiLKyEgiwuKs89YVKT5bBpfRDulmnvDjsUuiZ+EYbOJ7JEGyz6E/MKrFYAk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620117285; h=Content-Type: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; bh=+RujCyZGVC+T48Sg8vsxPAQvBpkzCIGoJ/nXzE8eWRo=; b=PqCvdLoy3hv+/mxAHuD+iFeSUTTh7yT+MDPtrsZCQtpukaZtMTl7G2h3iHV2eNRLWLkAy9zRakBzMTF4N72f6yL/+cOTDZKR0lNhzP1WD1hEneLkiiO8OI4hPVAOuBO89VJx5OEwhnY7Rg2YUde2GQYHskmJ9QoU+rfJzYqpNHc= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; 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; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine 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 1620117285860372.15977067162464; Tue, 4 May 2021 01:34:45 -0700 (PDT) Received: from localhost ([::1]:39628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldqVw-0005xY-SA for importer@patchew.org; Tue, 04 May 2021 04:34:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldqNu-0007yw-3x; Tue, 04 May 2021 04:26:26 -0400 Received: from mail-db8eur05on2116.outbound.protection.outlook.com ([40.107.20.116]:45350 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldqNp-0007Kk-RW; Tue, 04 May 2021 04:26:25 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3381.eurprd08.prod.outlook.com (2603:10a6:20b:43::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.44; Tue, 4 May 2021 08:26:10 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4108.024; Tue, 4 May 2021 08:26:10 +0000 Received: from localhost.localdomain (185.215.60.251) by HE1P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.27 via Frontend Transport; Tue, 4 May 2021 08:26:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LE28ikcYLk28MVvE6cbuRSnn+rkxs4Jjs1ZYIeS8qJlcGSS+Em1YGQB5awYL3rVOMvY26oHs60/5PAGwQ/5NWXAGlDps/kwHQlW7o+GAHkZFbggfGYQa7GWwFpsWzWa5iBqqbf+zTk7JqQeEo1Ok/xgLTxosDqog5B06Gpg4meDU3RydWSsLUE+caoSpvp9TpojZVcUZr55ZR7v/aDZZ8s4Tpqoh/rlax6NUX7NqHVO2k2MalWpYl8ZHPm4suGhGukxrbctTqh+dA+LSLclxy5dJuA2mX2UaF4hXSLEkEIYVj2PTJ5ASzbCIbXolAIJ97t37lFAnGVY7RQcw6IAZew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+RujCyZGVC+T48Sg8vsxPAQvBpkzCIGoJ/nXzE8eWRo=; b=lweXBMlIdZagtLNi6oCdVJoasFrvexViRMXCZxavmpMTc4aRtSFGya0yPGEc8TyVu1Zem2mAYUhM1Zj9LBrUavnbbTgOc+Gz7MqB/jTOt9mjNnu9enQlGkf/BxTM4kwYkFWpm/IiyOJPxJUrLJnJQ+8x9Or2nj1E9DOe1hHX3alqnqErUpAkV3WEPtk6a+8NZdCaqxkfA5QgpJhMR/WBNH5ElUowiF4w65Z4FPplDxlRSSV26ryvzcweu9w94k3mdkPkKNoT9s5fIQR3irBm8/loW6KfVhc9ZZG37l7/iSYHfygdQ7TYdiHk0PPpjHQ5RojR/XfsljyJcWYQ5RW/Iw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+RujCyZGVC+T48Sg8vsxPAQvBpkzCIGoJ/nXzE8eWRo=; b=CNeFBQosEMnbsUBOAryv5PJzZPJzToVb5eszIk3k7JT0NUp2YWo+0ZcgqIw3/280c9ZUP0tmamf7afqgRuQZYmpUxPa8DXtHteR6fw/FVC19zJfEnPzM2n+Tn0NYULEJAMGDTJz5vS8waZsYa96bXFQa7LltWCHa7rDcI8w6REQ= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, fam@euphon.net, stefanha@redhat.com, mreitz@redhat.com, kwolf@redhat.com, vsementsov@virtuozzo.com, eesposit@redhat.com, pbonzini@redhat.com Subject: [PATCH v2 2/9] block: drop write notifiers Date: Tue, 4 May 2021 11:25:46 +0300 Message-Id: <20210504082553.20377-3-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210504082553.20377-1-vsementsov@virtuozzo.com> References: <20210504082553.20377-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.251] X-ClientProxiedBy: HE1P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::23) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d49b7cbc-fc24-407f-79a3-08d90ed6456c X-MS-TrafficTypeDiagnostic: AM6PR08MB3381: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:168; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zlD/hhuDHyRQhrrV5R1x90C9ffVhv8MH6ZtTTT7m9XCs++oL+RtK62TJmzF14L6cH5bVDtSYcn1NRP3cpAnY2qt/LkO/r+zlq8EkaoYHogZvoqcTa7qNnwHb6rYL6t7pOeB94BdGXg0XpmjUX+qtdWtp4H/uukRrUipBnJqelg+GaAJJi9cze/iSsxguOkteXXqhXFwiDsCcWifBRZELwfD9y8S2kj6ynX9fwmcAo/q+pART9fNryc1V3u2zMaiEA52xhVfS7/ENtbNVb7j11lwP/BOoivy8BTCwQIWeiEppohT3b1JWOgLJyNrCppT43ugyqA+JXzIXSNeDr+Tq/XNfk6sVq5m8JkfAPzDXOGH0khdxSYlRDjbFQyVUHL/GPpk96KWPUyAhMUTkEWDXVULeg9UeZ/NrPGM+B/H+BNT/tCR7DvPIj7rzRJ7eZiI+9HI3R7H5C2iEBXYza0PcuSl5BpTpsyMg2si+ReAj6b7idGMAl9eQxPVz2iOoTV+8PILEtl9vJsfkiTrBeEc8XyjV1lN+w/SIE5ZJGNx1J4P8ZHz6YOSmNykNlh2mShLCChcnXAtLj53j1MDREhHs4kd0jnsDecc19fPDreizCwSXezCc3MsotQEIewXqHGmEKQrlvVrq707Yu5CaoxSE4pW7NA0HQ0RqWeHKZIwqDV36tI9NTHH/ih+f8eqh2qA/ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39830400003)(376002)(346002)(366004)(396003)(6666004)(83380400001)(38350700002)(38100700002)(5660300002)(8676002)(36756003)(16526019)(2616005)(186003)(956004)(1076003)(2906002)(316002)(4326008)(6506007)(478600001)(6486002)(26005)(8936002)(6916009)(6512007)(86362001)(66946007)(52116002)(66556008)(66476007)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?7KDO/RrMyUUOBr2AOQROboLVfb+tTQiL+LxGSFOTvgt8280uaa9SgbPjnrOY?= =?us-ascii?Q?1hSqt+NBaM82aZUb8CFNa6N8onKxXRCP8za8npVSjP0lyEbViwyPMicFH9Jh?= =?us-ascii?Q?h1OX2okBsEaGN2E9colYP8YJTDlptZ5yYBvPwvh7Lqxr3mL8nCvLMhHxlnK8?= =?us-ascii?Q?ddYoJtRvG1SuLTfUXuNEF4ZDul7Cw3xno57bVlLEXJu6I+FKaHp0abuE+NF4?= =?us-ascii?Q?R68zDwNPxL56OPYUI9nHkapyoA8cgsZJlphSSFGLaSWl/6HGJwGFamucdtBk?= =?us-ascii?Q?5BEC1YgTFS8BEEAA2xSeJQ4b5CfwOuj8dLbr3KgwPIbcusBZBN2jMIGLHXLg?= =?us-ascii?Q?gfR4rav+YGhQcXd3w6smVObuu73lVyTiBTNEBBf8QFcAJ3hDYJQXkkDAUSz2?= =?us-ascii?Q?/PcbYgFt+zVXdh/BrfXbjyg3NGY6lXgW4lSvnT3RyUJHH2QT6V+j9LPPDjNg?= =?us-ascii?Q?od/vtOwl4qXuK74ONmckR/QLgcReV+ecKFxvw50xFMcmJ3YzzpY9A+bs9E3g?= =?us-ascii?Q?o1qth+IMgoTOWEPZjUHYfxaSwD8RZlT5t1qeX0xkPUDervSjHLRfHiU9e34y?= =?us-ascii?Q?DkhBRonNMHWB26oL0hcHgKGFLVeOxVUqVGjs4Qz9artfhpI7P8hBxHtWuxsa?= =?us-ascii?Q?qtEle4Q2p+AOSymO2tG1kxhKD9UWWnkrVMzvujEjNLhEgoETHHeCRWnE9fFp?= =?us-ascii?Q?DpJk0FhNI6rpBWBIJ/ZBKI6GgrqDlUYatHatNu0dqzH3GqNjEY45+oqV/6Ya?= =?us-ascii?Q?uD/tBfsIwty/rYNda8Q6GfOrIIIsuIHeqZxlrWr0T/7B7sF/4U7dprVoRtWf?= =?us-ascii?Q?DSdfVh9OQftZSvnvScFMpZ1yxi5GaVnUfi6QoTRkGVLRQjhscZl9cTzvkHo0?= =?us-ascii?Q?+mXGDEiDI0EbkwGvd/6W5vZ8MHRxUE9pJYwiqVTyFhCyVUcgDBQyWMStc25M?= =?us-ascii?Q?XE5ihkLa2p+yfyGmTq7fr3h6yUmCqZpmD7jYRbMbHjOOBVqkgw1J262lZ8aD?= =?us-ascii?Q?CGrQmB9sWvSYn3DiBviw6LOFPGNqvWzXsC9dgDc0Bcq2kELLqSYpfLu5aPQC?= =?us-ascii?Q?HkkYLoAH5Q3vPLjaSDCbCarORBTYzq7pwZGmxVg/QSodT+/bc42qSLJEvm+x?= =?us-ascii?Q?l2lio24XLAEz/LTRTV4WMIU54lPoEB+DDRzn4bLbzC/mXg4Dal0E+jhxhwZm?= =?us-ascii?Q?GmNhfFCScG2yjLDmIKBFcIMlUcp4XpCB2enTzJGArul90UpTuPQ4uFcSJer5?= =?us-ascii?Q?3hdMgtKw5sDLq57TIyryJlHQwOUJq5hkaJjaH0SjVmPqyoEKOPkiSOTWc1Ss?= =?us-ascii?Q?d2BUoDYm98i1KpCZn68a6BVn?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d49b7cbc-fc24-407f-79a3-08d90ed6456c X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2021 08:26:10.1447 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: O6z3sPkO+lvkHGhRZomXpGL1wxVIQ0G0u78yrWb/KblKRFAPKG1N0yGfPMVL5NbX3AgNCkudNN6r6w11UTrOL3mzhI3dNCWL3qunzlFDJSo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3381 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=40.107.20.116; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" They are unused now. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/block/block_int.h | 12 ------------ block.c | 1 - block/io.c | 6 ------ 3 files changed, 19 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index 51f51286a5..eab352f363 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -954,9 +954,6 @@ struct BlockDriverState { */ int64_t total_sectors; =20 - /* Callback before write request is processed */ - NotifierWithReturnList before_write_notifiers; - /* threshold limit for writes, in bytes. "High water mark". */ uint64_t write_threshold_offset; =20 @@ -1083,15 +1080,6 @@ void bdrv_parse_filename_strip_prefix(const char *fi= lename, const char *prefix, bool bdrv_backing_overridden(BlockDriverState *bs); =20 =20 -/** - * bdrv_add_before_write_notifier: - * - * Register a callback that is invoked before write requests are processed= but - * after any throttling or waiting for overlapping requests. - */ -void bdrv_add_before_write_notifier(BlockDriverState *bs, - NotifierWithReturn *notifier); - /** * bdrv_add_aio_context_notifier: * diff --git a/block.c b/block.c index 874c22c43e..e3c6c6ed93 100644 --- a/block.c +++ b/block.c @@ -401,7 +401,6 @@ BlockDriverState *bdrv_new(void) for (i =3D 0; i < BLOCK_OP_TYPE_MAX; i++) { QLIST_INIT(&bs->op_blockers[i]); } - notifier_with_return_list_init(&bs->before_write_notifiers); qemu_co_mutex_init(&bs->reqs_lock); qemu_mutex_init(&bs->dirty_bitmap_mutex); bs->refcnt =3D 1; diff --git a/block/io.c b/block/io.c index 3520de51bb..1e826ba9e8 100644 --- a/block/io.c +++ b/block/io.c @@ -3165,12 +3165,6 @@ bool bdrv_qiov_is_aligned(BlockDriverState *bs, QEMU= IOVector *qiov) return true; } =20 -void bdrv_add_before_write_notifier(BlockDriverState *bs, - NotifierWithReturn *notifier) -{ - notifier_with_return_list_add(&bs->before_write_notifiers, notifier); -} - void bdrv_io_plug(BlockDriverState *bs) { BdrvChild *child; --=20 2.29.2 From nobody Fri Apr 26 14:03:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1620117268; cv=pass; d=zohomail.com; s=zohoarc; b=DvxJaciSDCol5Nbd9vqOe5bA2cDxG6r+J7yxL9/rp2JA0/s7ErZI0yC1WBIfWly280WYGblsNF/hsQhTyiHkwJaLkv2G4i5cV/J1sIRJ+jmhRINI9hbEGZuxgVIT69QosOrIcizNNLJZFR1blitKlWuEq4OOBOUV0KuaAgZC8kg= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620117268; h=Content-Type: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; bh=YNfYhsFm/ch6xJUl6uIIpImvw3uBZcm5EC4dzHctZiU=; b=mvcxQjfMhcBlBUa7av3QBsUwVjFT3WR1i1bEd1SU6x1I4fSb/GZLZzqqd6AHQ2MZTaOiec+C17zA7L0DEigfgCAw9P9HWcbyVFQJ0kkf15ky67q70ZhqYqXGQqkSwesyxhXAoNttIBSAzZ/kdm4RDkmB2mbPRoBqR2E9tuD7vAc= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; 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; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine 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 1620117268769964.2635312897262; Tue, 4 May 2021 01:34:28 -0700 (PDT) Received: from localhost ([::1]:38114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldqVf-0005Jb-6w for importer@patchew.org; Tue, 04 May 2021 04:34:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldqNw-0007ze-AO; Tue, 04 May 2021 04:26:28 -0400 Received: from mail-db8eur05on2118.outbound.protection.outlook.com ([40.107.20.118]:10464 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldqNs-0007EP-Vl; Tue, 04 May 2021 04:26:28 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3381.eurprd08.prod.outlook.com (2603:10a6:20b:43::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.44; Tue, 4 May 2021 08:26:11 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4108.024; Tue, 4 May 2021 08:26:11 +0000 Received: from localhost.localdomain (185.215.60.251) by HE1P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.27 via Frontend Transport; Tue, 4 May 2021 08:26:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ef/dR4DzpUgYyMNbPRdFLaxdWLmbwSqDkHWX80fymYbD7ZLkxlX09kzXfeENBQFZuXV+M4uRCM7belYGXwmYOK6EsOw/DWHKdxTw/UmT12ETVrFj5gX0APGPNm15CG5RD+dA4GnRsRnhKOloKjKit6CTEH3Vb2t/WKAuei878A+Owk7TMfa1mW5RlbNUo22yAIqxN8DiwNe3C1FvZEqzSt9kZMA4hI3qPGG/J6ooFRhiEzdIuqg4CWSocCmX7axAV72QU5+8mHdUppxPxirGofTOk4EA739ZaOLssGDjvuFb9ESaSkK/qaKPiFLTFGehu/T80k/wiE6cPM8yq0Gzag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YNfYhsFm/ch6xJUl6uIIpImvw3uBZcm5EC4dzHctZiU=; b=ZDbA+d+InFeQdE1vK7tbDkjsD3JdQ9RdNLF1rjBFKThyoiW3ERlz2NyN7hcMeTHyORpZ7T61LFjQ/u8Xh+RvhP7JbZrkegeZELI46LZshCPR5rypoawbludeZgU/fTfiVNkIFPzzYJBUAwgbXINUnVlFvEPa74rb9NusQ1FYApUFaVaBu2/0uYLZYnmuFJeIntvUQTZX2KUPvWE6EH4NJhplBIpjzSWUmL8XRQq/2suROE9KvI6aWWnYITSvGaNnYRc/U0oWdlcQeQguCugiL0gKYKchmTQsYY/vOT/FeZz8nq83Na2xtujt0ZFepJnqoryv8xCvkEfoj97NU8/RHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YNfYhsFm/ch6xJUl6uIIpImvw3uBZcm5EC4dzHctZiU=; b=b46sOU/IE92XQx+cpadgPutqItPIAZ4P/VfVuLyYN8DrZQ4ndByjyAILPwDpXO8XtsogUkczCir+Sf2mP6hGD8Bmi6SpJUUcEVR166xXPHIiFHZIl4Bn/zQthKtjvOBZIbWLd4ZfxQYHtvx1oxReLEayhpY46Q2C8osQpFUKsFw= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, fam@euphon.net, stefanha@redhat.com, mreitz@redhat.com, kwolf@redhat.com, vsementsov@virtuozzo.com, eesposit@redhat.com, pbonzini@redhat.com Subject: [PATCH v2 3/9] test-write-threshold: rewrite test_threshold_(not_)trigger tests Date: Tue, 4 May 2021 11:25:47 +0300 Message-Id: <20210504082553.20377-4-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210504082553.20377-1-vsementsov@virtuozzo.com> References: <20210504082553.20377-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.251] X-ClientProxiedBy: HE1P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::23) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5cc5b946-4019-499e-5c78-08d90ed64619 X-MS-TrafficTypeDiagnostic: AM6PR08MB3381: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2582; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TGaLL+fNqfchdweR+E1e1hnvl8XF+IQsYivoCd5dCCWVCtdQorO5srcOVfujq6wibBZt0b4oH+O+Rbr1b7F3ccMLUb/ziBHLdIcByywrp+2JNOdjYTnGDLSg/c1ll9Qz9qag1jcG7sg1Rv1R8dkNXtn22Kr+z6v7VEdHH4nWZtU2qpfaLzQMXjR8rmBKrIxr8AHbyyipRQoFI2pmgRu05Nn3CP7/cAMPJ+8OzBAfVf9y0l7KGLnn1aYxljAsA+eGh2CP0rkYoxOBV/qrYGFek4QS/EWnKyyTCXi3Ltq5chz/7opoklfJ8/59zBkNpphDj7LrA69L0bHC2bjDNMAigzvIEM+5gKml4EXtdYD5Be3WEhcSchvKTO+eL0EDmrEmTZWMymbiNvJi+3eptEJjNG4aiQu3NCzrWxTbmO112NExkBtmWjVIIDn1A44RlA6ShHIcwYTwtPyA1ZaDfl0EShpq5lR8beFxIRClmyK0WK9pr0I5NHfgSPD5iqg+mTawQmmY5NcRw18Ow83g5qZ0OPxZ8UqxOFZHIHEyppaX/MSbYGy0BjlCgwc4OSO6ZumzsOwpKlJmB8yVXeCLwu1RGkvvt4JJumYQMf+Ov49YiKcPpgFaj+N5QaHKoPhbGjYGccMTR0TswVtzApLwt9iXNvT7LV3j8t80TesyTeRK2kX3QOHzz49oi2Pqk3lW4K78 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39830400003)(376002)(346002)(366004)(396003)(6666004)(83380400001)(38350700002)(38100700002)(5660300002)(8676002)(36756003)(16526019)(2616005)(186003)(956004)(1076003)(2906002)(316002)(4326008)(6506007)(478600001)(6486002)(26005)(8936002)(6916009)(6512007)(86362001)(66946007)(52116002)(66556008)(66476007)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?+NU2tP2OEbpJ9La8vFkq2VXGUEGuUkzHgGGYogElCNOnJ7IJfU4CdFFjuGAY?= =?us-ascii?Q?Aw3LyEfcmDDGCBCc3TUOLpHJxq2bUEVqEP77v9VzQEm2iqINzrTrxJwgUBRx?= =?us-ascii?Q?lKYpa754j+sGkvwl2igO617Ghe2mTzONt9kV4vQFt8yqlUQh10Vtn3jA9VgV?= =?us-ascii?Q?C0UEfBSraOJ+0xPSrU03t4bt1HbwtFpfBN2UySo1v8uBggll5oNoVV0T5QU+?= =?us-ascii?Q?Z/ZOqJeIUAQiYsPDWMIbkw4cHNY+S/2LuZWz8WzD/Kld1iXbNm9Ev6PBye8R?= =?us-ascii?Q?RkTqngZW9gDt4V+FN5fstm0EIIwPZIcvjREwHkxCn2+6Nz6UDiU/G+Wwyz0t?= =?us-ascii?Q?OZx2GGNJNDU+NIJHOgvt7qcnh9zrgn6GqwFwQND13RyR16XsF0PqaWbC1CDh?= =?us-ascii?Q?jOPlAYRxkNseSDdo6MydHArxurKzBYeW1ypbrfRA4cWX4ss5mOL7BK3+f/pk?= =?us-ascii?Q?Y/JRAeGwKDKapQ+a/sFid9O32lGT04OgAWzNjer5249kSDkB2EQz2Vjyzu5M?= =?us-ascii?Q?cyxEUK936JGgemc+v6QzWLArXFOeydE6RHTOGDHncfyKYhgu/NdcGfhFJ/sq?= =?us-ascii?Q?eQAWLf9PGotFAVEtHhMvmm6xxp0F1lOU4wpEIg2emg/iGhIsKUW+Y7ooe0z8?= =?us-ascii?Q?AdwOvwpyZ0iJUTrULjsZZe3W+odV014Hy33ntIDyD1TqA5yA6J8qLOHur3kd?= =?us-ascii?Q?idSY7tD9j8XDl76CzS0x0CuGoP3HggYgqMuukkCXnZQqgJfpYLi4Wsp+BDiq?= =?us-ascii?Q?gEPZn1knhhMLxtN6cdK3LlrYey95ICH/+MKZuZUjklVpnOKwwbdkyB3mjx9W?= =?us-ascii?Q?eKN+Q4K9lZHSYGJkumc/pwJLvB03Bmb35EAzyP7z6cCSQEQQmIomBskF1MHU?= =?us-ascii?Q?j2nzbtffcaVKnW0VXb1DIsSKIUwmjHWzTOOdTznnDmzoa73hR7gZXvB261Ga?= =?us-ascii?Q?SydJiYjfEsA85VzrPv+I6GlOMqnuP9Tt7PjkX4pRbxd+pExag6T5tPMErkx9?= =?us-ascii?Q?/3jGk6+5MmU3l8lJ0U5XgvnrSw5DROTYsSWvpYZP54GlbuLdyyrDRhRu4qAR?= =?us-ascii?Q?ryLeU1kqGBKPZ/UJTv/5a/ZvipQlrU+3x120nWIwv1BzlorJTqoNu6nP0CM6?= =?us-ascii?Q?hOB+SjbQEzu1rbKWxIarlkbJBpATs/9NuiNCTfyxxYJv+ScmUtpsDj1llSbE?= =?us-ascii?Q?c1R29loplL8kwFFU5ITqsCEk2LJ7jZUVIaOEv1zCdyos2zr3P8junnQIQdCo?= =?us-ascii?Q?47hiAFdRZdRENGG+B/SS6rpWTNl0glFMfDpbpSrwOuGKPPxg+h6KK7runScz?= =?us-ascii?Q?gjDJRP32JMLn2vzPCNQ1amc+?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5cc5b946-4019-499e-5c78-08d90ed64619 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2021 08:26:11.2847 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: beE+6+6oa1KUuR2r9c8u4yml1IE0FXoLoSoJOf/QNR3ZOLUporcmVtLjX0xWinVa6qbfGyTfEv8ZYm5HY5T6OrsQ2GL1B/ww/3IuG1UNa7g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3381 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=40.107.20.118; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" These tests use bdrv_write_threshold_exceeded() API, which is used only for test. Better is testing real API, which is used in block.c as well. So, let's call bdrv_write_threshold_check_write(), and check is bs->write_threshold_offset cleared or not (it's cleared iff threshold triggered). Also we get rid of BdrvTrackedRequest use here. Tracked requests are unrelated to write-threshold since we get rid of write notifiers. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/unit/test-write-threshold.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/tests/unit/test-write-threshold.c b/tests/unit/test-write-thre= shold.c index fc1c45a2eb..fd40a815b8 100644 --- a/tests/unit/test-write-threshold.c +++ b/tests/unit/test-write-threshold.c @@ -55,41 +55,27 @@ static void test_threshold_multi_set_get(void) =20 static void test_threshold_not_trigger(void) { - uint64_t amount =3D 0; uint64_t threshold =3D 4 * 1024 * 1024; BlockDriverState bs; - BdrvTrackedRequest req; =20 memset(&bs, 0, sizeof(bs)); - memset(&req, 0, sizeof(req)); - req.offset =3D 1024; - req.bytes =3D 1024; - - bdrv_check_request(req.offset, req.bytes, &error_abort); =20 bdrv_write_threshold_set(&bs, threshold); - amount =3D bdrv_write_threshold_exceeded(&bs, &req); - g_assert_cmpuint(amount, =3D=3D, 0); + bdrv_write_threshold_check_write(&bs, 1024, 1024); + g_assert_cmpuint(bdrv_write_threshold_get(&bs), =3D=3D, threshold); } =20 =20 static void test_threshold_trigger(void) { - uint64_t amount =3D 0; uint64_t threshold =3D 4 * 1024 * 1024; BlockDriverState bs; - BdrvTrackedRequest req; =20 memset(&bs, 0, sizeof(bs)); - memset(&req, 0, sizeof(req)); - req.offset =3D (4 * 1024 * 1024) - 1024; - req.bytes =3D 2 * 1024; - - bdrv_check_request(req.offset, req.bytes, &error_abort); =20 bdrv_write_threshold_set(&bs, threshold); - amount =3D bdrv_write_threshold_exceeded(&bs, &req); - g_assert_cmpuint(amount, >=3D, 1024); + bdrv_write_threshold_check_write(&bs, threshold - 1024, 2 * 1024); + g_assert_cmpuint(bdrv_write_threshold_get(&bs), =3D=3D, 0); } =20 typedef struct TestStruct { --=20 2.29.2 From nobody Fri Apr 26 14:03:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1620117476; cv=pass; d=zohomail.com; s=zohoarc; b=i9USGV97bhd/pTt441A++1Emhe7OhdF31hZuxxxKdPS+JgZMKw0pU0ztGkNDdd8Mo9CgqHKVArP6F11uuGKu8RBD89dK1Lf99OQ6xpF+zF/muPQ5SR8yvsX2NjSb+tQDWTCsA3i14RD9+mhXnGRDGm8Y9oAgtrI7xxmQXSw9NAA= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620117476; h=Content-Type: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; bh=mbmWq0+M5WcdTHXFZZXKkkehyopOozqA61ekt6M5Bpo=; b=MSm3Zk37/lsz1y1AnO1+ns7TnXUD8NeZWYwZpQ9EQJwNZU51xzQbZM6zFNIhctx1MZ0+SJ7cQWFWqWeWDpzZFG+j+ZVa7IGsm+qCW1qybQ/kvwcvWoUdCBCvvaGgErVDdzKsgerJiVwIiWJgNEhLsIZkzEX3yZsTtWCDo/SAoSc= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; 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; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine 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 1620117476934527.8790956057636; Tue, 4 May 2021 01:37:56 -0700 (PDT) Received: from localhost ([::1]:45482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldqZ1-0008WO-QU for importer@patchew.org; Tue, 04 May 2021 04:37:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldqNz-000819-2Z; Tue, 04 May 2021 04:26:32 -0400 Received: from mail-db8eur05on2116.outbound.protection.outlook.com ([40.107.20.116]:45350 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldqNv-0007Kk-2w; Tue, 04 May 2021 04:26:30 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3381.eurprd08.prod.outlook.com (2603:10a6:20b:43::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.44; Tue, 4 May 2021 08:26:12 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4108.024; Tue, 4 May 2021 08:26:12 +0000 Received: from localhost.localdomain (185.215.60.251) by HE1P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.27 via Frontend Transport; Tue, 4 May 2021 08:26:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=APKJEc88U308/aPkxfuAYGvq40cKRWJRk+sDuxY2VFOOhYL0iolKo8l2ccDFprZrpw8vhKptw9u6BKKel7QQni5ZnIkk9O68SpLts6UZQ0UGQPH/+/tko7CwfCCT3WTu38HFGRinpO1kA0g4x3GRKhdyZEuhfN4KPSJ6fyjgqhFpni5q9a57PfsFsvEpv3/FxnxrulmK9hJIPcDTgxAC44bHUwytEs8x1dxf/6+AjLQOYrQd/vSxq9RXFFvmLpqKQ/X1dleRTEVezPj/ogzlywk1wT6J7EfS+kr/uBt7nVFM00GNrQTepj6nwWn9M30VgB6sxLRp6uMLm7M5hZk8Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mbmWq0+M5WcdTHXFZZXKkkehyopOozqA61ekt6M5Bpo=; b=XtePKI4M5RPjh4KonrLlMWu1VW/q1hFJy0XfF+7Q+mec5qszNV+86UlZYaRrYoez3t/CF/LO1j8XY3maFDzPOgpTB5+rHfcck9o++L/uugOnqaH1gXtBZG3VBBTK8Vc93MENimn5QQDVVu5/AvNUHMcuZR7M5ttkNxdBWTAAcoaXxi8h6+F+Pr3nXQpRqezwV6ie20GOEUiaD8D0DSPyX42cnvDk+1ZjiP6M++SWzqY/eIHY0z19UBIJBex++oJIZpr/Tnu/2ixeQp3BH44k5HIDDItXQ6f7XoI8n3plJe9o+3JR4ahJMl8eE/2iHJ0LxcMZuDGvjJNg6OGntsGgnw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mbmWq0+M5WcdTHXFZZXKkkehyopOozqA61ekt6M5Bpo=; b=qvI6/jTf2deZFI7DqAoKYuyxLQIrj57IAOGKK2+HiDaDmedQo/7d41PENtEKsTTqrcP4cqJmYI9rVLBEkOlxS6kA9CvHKzg3aoLazO3AwkCwg8hp7KhcJ0u0xy6xV+ZqreZ8lkZXmbGJxVPBPO+KPC4+YZbrpPvR++/DB40tvoM= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, fam@euphon.net, stefanha@redhat.com, mreitz@redhat.com, kwolf@redhat.com, vsementsov@virtuozzo.com, eesposit@redhat.com, pbonzini@redhat.com Subject: [PATCH v2 4/9] block/write-threshold: drop extra APIs Date: Tue, 4 May 2021 11:25:48 +0300 Message-Id: <20210504082553.20377-5-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210504082553.20377-1-vsementsov@virtuozzo.com> References: <20210504082553.20377-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.251] X-ClientProxiedBy: HE1P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::23) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d8b0f78b-b08b-48af-05a4-08d90ed646d8 X-MS-TrafficTypeDiagnostic: AM6PR08MB3381: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4XWZIqtVLug8wz4SVrOv4mrlPKWwylJCxvW9pYewSG4cMBQeWNPVhq4rhG8DiCtzlYJRBeLX9d5gNDNTCaf5TpRZa2Ve1C2Lbnp1KZ1L3ZY0+p5/soyi8IjrjUQPXV5NIFSPpfWP13xYuYKoNhpV4dRaV7DTs9eLhu8bgIofYHmX1JeUAcGR3FfWloAoKzKGhCvKVgnM/mevytPzMqKib6spGOnh53SVyICSP1EknKfmYVlnRkqFwF6uRc7GoycubYOsDqwXIn0s5CAT5rmqqqPhWIdSrXzccY2euYISyevBiY1sT0bEa7HX78SicREuB06ld722Ki9Mod10Dw2uo/CETYLhJhTRcj/JsGqqr8iRWfv9zru5xy60hyjoTMEVj/XXXgZ0AkWW44MFzx7ZqEFTd93YbivoJmaQPF6kAX8vHgG3+czpQ0x/M6RJ+i+vmg5dZAUgroDGdevt2Pkt9wcbDqydHTyYTpZFbGV1wm7tBAX7OIf6tvYKIgd9/LzX37YsPtpL4C567q3WQiPQjn21cMuRuhJ0YyQrB0FKxlq4GTHVSM08x6DT9Zcw6nyscLuUNsGp2GTcdj30qTYWKYMjj9xVxA2PC/LrP5wOv4YZHVQAturhHzduefOZ1lJMmqFB2UJJI4N5M1ZY6ATHoGX4nojIUjfy+NRwNqvey5Blu7X75fDvZo6hES1E5oYH X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39830400003)(376002)(346002)(366004)(396003)(6666004)(83380400001)(38350700002)(38100700002)(5660300002)(8676002)(36756003)(16526019)(2616005)(186003)(956004)(1076003)(2906002)(316002)(4326008)(6506007)(478600001)(6486002)(26005)(8936002)(6916009)(6512007)(86362001)(66946007)(52116002)(66556008)(66476007)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?FnsImJJIXio8hMNOp7jeT0vFecjy6SPlIl8t2zSx35sTGNcigTIOeZu0x0UK?= =?us-ascii?Q?+fPjfv8PlMYfqxFYiyUDUWXoFuXlzmVroVMZxxmugwB4QnBF1ZAouzRu77Zm?= =?us-ascii?Q?pt0utlPXWTrnsozYQ9wFGZtFnK4+pFkwRqZtBTcPUTtO6qt+1ThLDLfnj1il?= =?us-ascii?Q?hvNYP5bHabITe3uDpxvLdGKNaiucMHmlF6662Nv9LPaVA291BGL/6EBI4zwv?= =?us-ascii?Q?64Ua8du4hCX3loyJFeaQoQ17huanp38Nu7ykkC/VarbAGx1yDsD3h0RoBksK?= =?us-ascii?Q?bVcYHS2q1arLytRQP5y4sJO6MzqfmD2GfYB3eJ3vwQT0HLvIy2fZgMS7KJ8M?= =?us-ascii?Q?odfF+nk7r8fcRID7SrKX3GJKh7mkLXrVt7jcJu564A04IKBqIBTINIQdU/dv?= =?us-ascii?Q?Wn7d6XxRMHNDztcF+ZT6IMKY78dQqMNo2cfYzHffZ88G2k8/HH4JxJIZ+qQW?= =?us-ascii?Q?WDd0r0hpPxe3YI+hZikfSHVQVz9ftRiVde6WKZZSfaxixLAIv+xD0SUZSYmA?= =?us-ascii?Q?o3rkaqvs8imm6UTpsXK/VGHSdTFcGp8eZN52kOzO1A2qpvGVt1i/q2JuMrGQ?= =?us-ascii?Q?SaVkrju+HQ7iqbF+54Xx5nfH4wcVvTofI0d8qBY7QiDg0UYBWnXjrQkLlcCz?= =?us-ascii?Q?YzKWCfbhZw+UJmpF/O7h1XOXKAmsP+IXs9XQV1uSLjC1nhfo4VlOFjnniEMw?= =?us-ascii?Q?Tx4B9/RZ+T+Sre6mGmbY2f0Sdg6w0PU+nKjc5ZLva7hA/ZBkMByfINIGMKiG?= =?us-ascii?Q?ULkN90LnRIRQ/nFRg89p0IUDG25lp1D3ykXiR1Pz7rp3rmGQQi7OBqIZB0ZW?= =?us-ascii?Q?giZvviQszIet+y+W2MZQIRAIPkWp+hOWSK7lAhJDR1dD7SZy+53a6X+7+KQz?= =?us-ascii?Q?KT9YVbQUr58MsAUPkM+lnGuiEV0EN+1dppkwcWlHE17Tcy4NRHQuvHeWyooA?= =?us-ascii?Q?Xk0w76NQ8jHggSJEi67LGq5IRbDz/9IofDGePWOWuud/0zdflJJOE74ZzQCI?= =?us-ascii?Q?Dig7BYvoLkPWea5uO64Ayn1p3CKU3F7ESGCGGCobRCGsjl/7bB6wZeH19zVo?= =?us-ascii?Q?FCaKLRDS+JVljQcZDRSymJHhNQk4zxhvV0xwqGgCvfQXSeq/bSEN5Li9Msk1?= =?us-ascii?Q?BbM10Jj0oBulCE/A8sdKYA+xJbyfCp6rhMEP9PcRC8py+svR1t6WeadJPM40?= =?us-ascii?Q?3lXNXx2GhJsftyEwxJOVZzJHQ8ffZgyU0w/ATzlO+40mWnvnLj0UDf2Nny6/?= =?us-ascii?Q?a+J3NeARPK+EN2DD0QLbqBK3EtFpPEEdfYYvQkdD0McwJaWA/D66ePDNxJqB?= =?us-ascii?Q?LJuD9auTwupkoOFged5zUHxZ?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d8b0f78b-b08b-48af-05a4-08d90ed646d8 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2021 08:26:12.5153 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5D54Bf+HpWbrZDeTMJN9RnqJqM/doz7UYHFfFwhDES0j1kEqp5XSM9ZgQ5mGR7BilqhAfpyTFwkEAr/YS5yKrOA84TM/gq7AMcjKS4S9P80= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3381 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=40.107.20.116; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" bdrv_write_threshold_exceeded() is unused at all. bdrv_write_threshold_is_set() is used only to double check the value of bs->write_threshold_offset in tests. No real sense in it (both tests do check real value with help of bdrv_write_threshold_get()) Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/block/write-threshold.h | 24 ------------------------ block/write-threshold.c | 19 ------------------- tests/unit/test-write-threshold.c | 4 ---- 3 files changed, 47 deletions(-) diff --git a/include/block/write-threshold.h b/include/block/write-threshol= d.h index 7942dcc368..072bc8f286 100644 --- a/include/block/write-threshold.h +++ b/include/block/write-threshold.h @@ -35,30 +35,6 @@ void bdrv_write_threshold_set(BlockDriverState *bs, uint= 64_t threshold_bytes); */ uint64_t bdrv_write_threshold_get(const BlockDriverState *bs); =20 -/* - * bdrv_write_threshold_is_set - * - * Tell if a write threshold is set for a given BDS. - */ -bool bdrv_write_threshold_is_set(const BlockDriverState *bs); - -/* - * bdrv_write_threshold_exceeded - * - * Return the extent of a write request that exceeded the threshold, - * or zero if the request is below the threshold. - * Return zero also if the threshold was not set. - * - * NOTE: here we assume the following holds for each request this code - * deals with: - * - * assert((req->offset + req->bytes) <=3D UINT64_MAX) - * - * Please not there is *not* an actual C assert(). - */ -uint64_t bdrv_write_threshold_exceeded(const BlockDriverState *bs, - const BdrvTrackedRequest *req); - /* * bdrv_write_threshold_check_write * diff --git a/block/write-threshold.c b/block/write-threshold.c index 11152c60df..ae54ee05dc 100644 --- a/block/write-threshold.c +++ b/block/write-threshold.c @@ -24,25 +24,6 @@ uint64_t bdrv_write_threshold_get(const BlockDriverState= *bs) return bs->write_threshold_offset; } =20 -bool bdrv_write_threshold_is_set(const BlockDriverState *bs) -{ - return bs->write_threshold_offset > 0; -} - -uint64_t bdrv_write_threshold_exceeded(const BlockDriverState *bs, - const BdrvTrackedRequest *req) -{ - if (bdrv_write_threshold_is_set(bs)) { - if (req->offset > bs->write_threshold_offset) { - return (req->offset - bs->write_threshold_offset) + req->bytes; - } - if ((req->offset + req->bytes) > bs->write_threshold_offset) { - return (req->offset + req->bytes) - bs->write_threshold_offset; - } - } - return 0; -} - void bdrv_write_threshold_set(BlockDriverState *bs, uint64_t threshold_byt= es) { bs->write_threshold_offset =3D threshold_bytes; diff --git a/tests/unit/test-write-threshold.c b/tests/unit/test-write-thre= shold.c index fd40a815b8..bb5c1a5217 100644 --- a/tests/unit/test-write-threshold.c +++ b/tests/unit/test-write-threshold.c @@ -18,8 +18,6 @@ static void test_threshold_not_set_on_init(void) BlockDriverState bs; memset(&bs, 0, sizeof(bs)); =20 - g_assert(!bdrv_write_threshold_is_set(&bs)); - res =3D bdrv_write_threshold_get(&bs); g_assert_cmpint(res, =3D=3D, 0); } @@ -33,8 +31,6 @@ static void test_threshold_set_get(void) =20 bdrv_write_threshold_set(&bs, threshold); =20 - g_assert(bdrv_write_threshold_is_set(&bs)); - res =3D bdrv_write_threshold_get(&bs); g_assert_cmpint(res, =3D=3D, threshold); } --=20 2.29.2 From nobody Fri Apr 26 14:03:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1620116955; cv=pass; d=zohomail.com; s=zohoarc; b=MvRjlANMWt+QprW8Ko67z/+9T+tbVxFGHHXhAZhPAm7ST2T02thSBvznuonfqdQTphgScrSAnRzFmHnB3dutox33inHWU/7yv68KtNUEfxNNXcs3nZEnDVdCulRTZXeGJuzRlAoPGTrhwBSfi/C2m1nHflOwuUbUvxyYFaIK+B0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620116955; h=Content-Type: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; bh=ZVnxqGECls+TQxCkbFAClRijhk/doPHsDIGULGvD54U=; b=FkvriP1qIfCaEpMne65nhILg1XrtoGEGM1J/diZ4Ii7tSHvjuab24ZZsuuo2eI9kBCUgWvLmF2Uk/eMqNZL5GgfWzvyjk7wYEC0hSKBWizP1m4x1HfZ2Mu5wMNry0KM6Im5SI4iQedXp6zId+G+vHNrVhkkBgnTjbMVcf3T7s6o= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; 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; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine 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 1620116955482256.72149011467525; Tue, 4 May 2021 01:29:15 -0700 (PDT) Received: from localhost ([::1]:58282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldqQc-0001my-7t for importer@patchew.org; Tue, 04 May 2021 04:29:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldqO2-00082Y-OA; Tue, 04 May 2021 04:26:35 -0400 Received: from mail-db8eur05on2118.outbound.protection.outlook.com ([40.107.20.118]:10464 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldqNx-0007EP-3A; Tue, 04 May 2021 04:26:34 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3381.eurprd08.prod.outlook.com (2603:10a6:20b:43::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.44; Tue, 4 May 2021 08:26:13 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4108.024; Tue, 4 May 2021 08:26:13 +0000 Received: from localhost.localdomain (185.215.60.251) by HE1P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.27 via Frontend Transport; Tue, 4 May 2021 08:26:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PvCZSWmVrrATEnqhsuqq3pv4p8QgLyRgnTJdjORngCjBYvylr1+ZZ9kfzsIJRmEshG1LZWBS/3TNoUY+a7qPr/T+Ll0AFHyUgJQAZI7ailwA1mYjzCwXd4zBl/FmtJgZX7jI6qvEMaIE9lY/3zpPV+clapKgJ9vwCl65CKvcRRe9N4Qa7zZp9zaFcvzle6pcEoM4xclsXMtr1AaQteGVsPy6poM9JZpMwQTl7zdbkI9FdUZ8opeZCgcVhRaUki0Px4Ter5p8/jXSpQxwP9ymyrt9Zb0Okya/21IS6GFOGNJ2955rW84P19J5J/OsYRtuXiSNltyfU10ajDz1cyo4jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZVnxqGECls+TQxCkbFAClRijhk/doPHsDIGULGvD54U=; b=Kn+IvZUum1lVTAJgI1ARO/Sr9cYRFuN2snDa+uaSFu38DmpItqOpQKaPb5vW7yu3BsuYnn/CI8u7Q2bwQVhkTgTm1T3lYxX5Bmjvv5arg7JgkbH2HQdZi88BOhOXIggo7OUvuIVeLvSRSCu/2GBR6Zdg5RdzLSzx+DVQAWv3XebbMQHyWhmLTjbequNOjdqYyVo3p1GGwcM1KQ7D7zfjF8O1ZqHaPH3rMh6zTz2oo5CMCvuMlpv5trueaU/NSZGxWR59bKOEGSl19kU92PAT3EgZ40O4r+RpY44tJbxfFEiRL9u6elcjnaFDTo0PLmjk0iAXwVLXzt3ZLXlQcxlXwQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZVnxqGECls+TQxCkbFAClRijhk/doPHsDIGULGvD54U=; b=cGxHu74ShbZOCxwg9SrF9eJigVc75A0Jee1nYN5/R8oTbyIBX/wQawa21HMIpWolmN79ndnpaVLiuCRe6HQ7NbUlJxeN7+HhMOGoVphHoZ7zz47KWG+UTkYwwTvwvACtQNuWAUdOSkmGw1K6tr3JMvATtfquk86hw8ihvz+gTZs= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, fam@euphon.net, stefanha@redhat.com, mreitz@redhat.com, kwolf@redhat.com, vsementsov@virtuozzo.com, eesposit@redhat.com, pbonzini@redhat.com Subject: [PATCH v2 5/9] block/write-threshold: don't use aio context lock Date: Tue, 4 May 2021 11:25:49 +0300 Message-Id: <20210504082553.20377-6-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210504082553.20377-1-vsementsov@virtuozzo.com> References: <20210504082553.20377-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.251] X-ClientProxiedBy: HE1P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::23) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0a468491-6373-462c-602b-08d90ed6477e X-MS-TrafficTypeDiagnostic: AM6PR08MB3381: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: khGZPQZT5N2Md7Ui1qoJy12gUIkm2kgqN6ijLiYHrJjfuSpWjEhGk9GBYHRhibzPTpTyCXKT68+MYvYUoV6fJWPyo5e/9P8TDOqwORsCa1Q8tu/FJZPPQla0bdjOFnIeRNaL8qSKtSEYDZd9JiNjmbAOF6tQv3iYNV1vKOi1JFMErGdwKT9rUUmTu2h+NZXNDaAlgVkQrmcQThmiOUKg6XRu0S6eNytLJsPCliYduflqJJD7nVEg/I3FNC3FnHonZadVVXnqjLJ7t7dyWA0lP2vER4E+RXG/W8RMVWEd8nmjtnsGsOWVPmXSejkggg93e7PQdfGRFvzQdVa3xgfVjNUQEbH0LuZPfPecAZ/MJmjm7FvAR7OAhSEWhvpc5rUijwzfmgSCyv44Mdu0RMHxkPQLRcdHoQSlx1MZwMGSTIgpmvwWSq0B50iWUJMwm63lSuMKw9ML6Qga77M/LgtqxM8GaJvlRyIY0XMqWRcKIDxBqUGrkoleAAEQZST3UWKe/k8oY7J2gTje4WTXpOBZ5BUi3dP3pspd3jsK5APTSUc1Z8Yk9M/sAvNZOxFUgC73/q4H+pSkuiUPhH1G0py0H5HMRI8u8s/uFgIrQkzCewyRArTF2zIP0qwYn5JptqWhRrLKbWsAYRmeOfAjKEY6GCaXHhREwcIACN7oYdprkbOfKMCNAPJ0RBiGHAhRGFVf X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39830400003)(376002)(346002)(366004)(396003)(6666004)(83380400001)(38350700002)(38100700002)(5660300002)(8676002)(36756003)(16526019)(2616005)(186003)(956004)(1076003)(2906002)(316002)(4326008)(6506007)(478600001)(6486002)(26005)(8936002)(6916009)(6512007)(86362001)(66946007)(52116002)(66556008)(66476007)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?o0lUNbwjciIqs3X6D49qtntb6ipi4hTPl9NRBd753WVA2TFyCCswi+kOhCyd?= =?us-ascii?Q?P0JZw1Joi8e+gRBsU8UhSogPsiyHk/0brIRedgaSnBLYcJUmp9e8nCLXuEIm?= =?us-ascii?Q?vQZ5fBcCplHTpFWYk7/PwRYUoHxl5ElUYnn8GxmX3sVK7D6bp4/cEh62z4h0?= =?us-ascii?Q?QD1mevCZELdNfWYOrxpjOBskf2lUmm4d06H5z+w/nq0NWvB1AxowVSHPWFv1?= =?us-ascii?Q?5igIKaDH7R+9eerDEhL+IGAxngmYhiviIoO/ZPvamjaw9fzVFiDiTnYtTHFe?= =?us-ascii?Q?yD9XmGu2DI1t8vM+kzmMXs/oNLydZ1kQiHQ+9/T2iwqOPNvkA+Al8ApB5wAF?= =?us-ascii?Q?htoCBl//DVZ/VmMTygbBvL1bLliLNLKzDIK+rlp3MGs+QoCsiI+J6qnbuMcr?= =?us-ascii?Q?zuK5/K1KP6HC0MDq6ikWToc58M5c0LprlxqPB66fYxUSvK+SlIXWIzBUC3Qv?= =?us-ascii?Q?Qg0umusoB36bhQ032gIPzauiLvZ+x7fG4WXUGWLBNGpJCVwCzNPC5TMuB2LV?= =?us-ascii?Q?5wrRwqMSOI3FypwW4xhLiukYITqRibixxe0wI8Jy3eABKAviMFbs70uaAOTX?= =?us-ascii?Q?x2z88HUqMLmE2qmSJxlphsfMSUum+eklJjN2BaSdceC58HqdYf05Ksb3uoFz?= =?us-ascii?Q?JrFHTvCsyKxnUmStjYRWRU+GcWsSJMHdVBaIlq8HC4Jh8h8MpHNj/osXGu2W?= =?us-ascii?Q?70l6t0ZXVGcGdmiK954xAS9QeIrnChbVnE9QW9qdH7zeaB6YM5bvFv49yp1R?= =?us-ascii?Q?z1rlBmVaU2sdnRqpKrztas901jYBtZWi+9zDm1ks0ijOQv+UVjR8fjtHQY7g?= =?us-ascii?Q?4yZ0BoNlM6G0gHxe5C8/uDW1iiSr9FDsBPx7icDbANPfmALhu4foofZXq10v?= =?us-ascii?Q?oKeIKT0EXmODTxPZVOqgViDhmjus/0qkWKd2120l79FW8q+ndyHV7Tmp4/cI?= =?us-ascii?Q?TYeyEYvcE6nkkf/5JMFdIpcw4Bio43xKZv+boMQgqHjAbMHDuahrIQBEyfjg?= =?us-ascii?Q?xw7FR/B+a/BjoyZXSDskbQ92UDd9SicElgnyffRCCXgm5ICgoMOCxlqMXqDq?= =?us-ascii?Q?2LkQOi920EG0Cq7Ckb1tS+oOj1QE0rNtpERusa+5XS8SnnCFtBa/0iptJH6g?= =?us-ascii?Q?XxSEFINKkwPyw4YH04NxDSKlPXGKFg0o2zaVHckhPMJyx7xAWnIds2wiqp8g?= =?us-ascii?Q?7fDE84Zz/xPA6YTw5U+iAhUaUOTYmpftv07n74gE55TwEp+UKCuDFZM0iZCu?= =?us-ascii?Q?QDl2g6il7tN9gQX2uypNpLxMusvtgfnJ49dS+LXJTNfICNnS8Yg/1+J57f0x?= =?us-ascii?Q?/ptXj+iepqIEN430lHSCox+e?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a468491-6373-462c-602b-08d90ed6477e X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2021 08:26:13.6752 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5wychzb+63ip/4qi+lOL5l9Da8xcxudX4bS8tUzxFIGDcR1DjDdasJMjgYNPBgqC/MximlmkjRQixJjQe9NgNS2MRei99t6REnbNwTe+lDY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3381 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=40.107.20.118; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" Instead of relying on aio context lock, let's make use of atomic operations. The tricky place is bdrv_write_threshold_check_write(): we want atomically unset bs->write_threshold_offset iff offset + bytes > bs->write_threshold_offset We don't have such atomic operation, so let's go in a loop: 1. fetch wtr atomically 2. if condition satisfied, try cmpxchg (if not satisfied, we are done, don't send event) 3. if cmpxchg succeeded, we are done (send event), else go to [1] Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/write-threshold.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/block/write-threshold.c b/block/write-threshold.c index ae54ee05dc..fbf4e6f5c4 100644 --- a/block/write-threshold.c +++ b/block/write-threshold.c @@ -2,6 +2,7 @@ * QEMU System Emulator block write threshold notification * * Copyright Red Hat, Inc. 2014 + * Copyright (c) 2021 Virtuozzo International GmbH. * * Authors: * Francesco Romani @@ -21,43 +22,44 @@ =20 uint64_t bdrv_write_threshold_get(const BlockDriverState *bs) { - return bs->write_threshold_offset; + return qatomic_read(&bs->write_threshold_offset); } =20 void bdrv_write_threshold_set(BlockDriverState *bs, uint64_t threshold_byt= es) { - bs->write_threshold_offset =3D threshold_bytes; + qatomic_set(&bs->write_threshold_offset, threshold_bytes); } =20 void qmp_block_set_write_threshold(const char *node_name, uint64_t threshold_bytes, Error **errp) { - BlockDriverState *bs; - AioContext *aio_context; - - bs =3D bdrv_find_node(node_name); + BlockDriverState *bs =3D bdrv_find_node(node_name); if (!bs) { error_setg(errp, "Device '%s' not found", node_name); return; } =20 - aio_context =3D bdrv_get_aio_context(bs); - aio_context_acquire(aio_context); - bdrv_write_threshold_set(bs, threshold_bytes); - - aio_context_release(aio_context); } =20 void bdrv_write_threshold_check_write(BlockDriverState *bs, int64_t offset, int64_t bytes) { int64_t end =3D offset + bytes; - uint64_t wtr =3D bs->write_threshold_offset; + uint64_t wtr; =20 - if (wtr > 0 && end > wtr) { - qapi_event_send_block_write_threshold(bs->node_name, end - wtr, wt= r); - bdrv_write_threshold_set(bs, 0); +retry: + wtr =3D bdrv_write_threshold_get(bs); + if (wtr =3D=3D 0 || wtr >=3D end) { + return; } + + if (qatomic_cmpxchg(&bs->write_threshold_offset, wtr, 0) !=3D wtr) { + /* bs->write_threshold_offset changed in parallel */ + goto retry; + } + + /* We have cleared bs->write_threshold_offset, so let's send event */ + qapi_event_send_block_write_threshold(bs->node_name, end - wtr, wtr); } --=20 2.29.2 From nobody Fri Apr 26 14:03:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1620117275; cv=pass; d=zohomail.com; s=zohoarc; b=RP+VCY4uHZzsfvM1RL4dAmBS/dtAeWLJqWlZ/UXNuo9HzZBExX6dmVpW4naEJ8hvdvHWKy6TjX7kf6lGjgGCM/CJXWQXIfUi3/wVyafpua0mAnR1nb/dLF95uNozV4YP2dJLTOz+tssvdngZe28Qe2W+4FLt8z1h+/RWIlOCE2U= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620117275; h=Content-Type: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; bh=GvmnDOR9x/Zvz8zJ5Jq1asZUkH4HLw+fQnWy+fGVoLw=; b=jsrgIebZzDNAO5jKBDEXXHvj/1/zoWpNJ8/zxPwUV99UE6rzUL+eWE+Qw83fIBOwaMiFKrg660FUfyDlPAsSxZfqMLW2mNdrbsBisiDbj+T9WpqcuGQ89WRi9qa4zedAKNibes4OyXCOTUhzntCAK69am3qubgWV5KDQkOQKtaQ= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; 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; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine 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 1620117275265632.2765325074643; Tue, 4 May 2021 01:34:35 -0700 (PDT) Received: from localhost ([::1]:38462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldqVm-0005UM-1w for importer@patchew.org; Tue, 04 May 2021 04:34:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldqO6-00084f-R4; Tue, 04 May 2021 04:26:40 -0400 Received: from mail-db8eur05on2116.outbound.protection.outlook.com ([40.107.20.116]:45350 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldqO0-0007Kk-J3; Tue, 04 May 2021 04:26:38 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3381.eurprd08.prod.outlook.com (2603:10a6:20b:43::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.44; Tue, 4 May 2021 08:26:14 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4108.024; Tue, 4 May 2021 08:26:14 +0000 Received: from localhost.localdomain (185.215.60.251) by HE1P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.27 via Frontend Transport; Tue, 4 May 2021 08:26:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CPcroBsUuj+BXHjYymTkC1Gs6k++E28YD/L8nxalokLMVDGLJOvkm2fi7IEfEtWCMUmqKxS8yF2hXNuCDmNAWTIBkzkpAh4fJ7cQA35X71LUPgHau0G05JdSn7FXdyIJcbZsxnzUPG/1WSakILEMIbaMFZRtp1i00jbVub5/Fsj2P7T/1tkk/GGyrD1pKwiM8k7rosYjUeIBh/cFTu49Hjuq8/kI4bOQ4rIXXT/ruvOIrVPGMX4QubT6Pm+T6OYRHXdPsMO3MYnfBgs4EuEmTRZPqWkC/EJ0YkTPjDO/C+6248tRWl6rsIuX+AN4N+8KsJWoWU/h/m5Y3UkUNct1hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GvmnDOR9x/Zvz8zJ5Jq1asZUkH4HLw+fQnWy+fGVoLw=; b=ZBmBJPSApig8y1q/Va/gHBx2mtCQwdaw8nrJcrQXFy0/ZmfRT+oDWui8RfNP1B2Vkt6wcrHomgFqBMJiDHWu2QiXRD11xiY5e052zv4INNo99Pyb1xgZXQ6TSI4Xu7f0gObBcjvTGn3bHkm4pKtjVw4cITkvj2hbg2cGyJOD+UPVuWr9btaEdGoeKM2pNs+BgI5npuz+BwXxa5AfofuRYh0kZVU9sbdUVJHK0Poc42vrvTThO3sPOUKTKEOM5vwkXx8p0mETNMqGdANsFpEL1giK6Zegsj7tolpHGEFDPFxJXuAz5dG+kVdw/KLK0aj+e9KfCXLlxoQknEdKje/8Xw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GvmnDOR9x/Zvz8zJ5Jq1asZUkH4HLw+fQnWy+fGVoLw=; b=OWnfq3FwlMx6ISLr3m58NiGIlE9A8d5alBEbFDeHUGEzS1PZ0nN9aUFJMDTp0Bq+JnkZnt1WKA1a453S9KjuYLU2yu3SxM4PPTtw79NOdLVHccuJi4xJY0OF6z13zlg9vZ+egKItOyMLGh4nv9p2a0P3K0e1spdZ92QgLtEdQAM= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, fam@euphon.net, stefanha@redhat.com, mreitz@redhat.com, kwolf@redhat.com, vsementsov@virtuozzo.com, eesposit@redhat.com, pbonzini@redhat.com Subject: [PATCH v2 6/9] test-write-threshold: drop extra tests Date: Tue, 4 May 2021 11:25:50 +0300 Message-Id: <20210504082553.20377-7-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210504082553.20377-1-vsementsov@virtuozzo.com> References: <20210504082553.20377-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.251] X-ClientProxiedBy: HE1P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::23) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 40e841ac-d546-40c1-56b2-08d90ed64831 X-MS-TrafficTypeDiagnostic: AM6PR08MB3381: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:561; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qDst5Xd+PMKSJ270UaBexRmqSOs1XJfq+wqWalvynG2e0t7SU21d+Uqu3DOImdolMUXonzy/yKkI2JkBpTxhPh557J3BUNLoBaUhDolaOVG8CtP04eK9YyXeUnU1zIbdrUfk6OoxcVBBUVGrqKt+HCO1W0n99NvCkK4RL7oMLM8qIEJOR8yysjFUm0rxIdSX5n67TCQZ8DYiP9JDwoRTLvXzRaKRs/TgNX8tSMUoC3sT+QkcCPig/KgO2+beBp/hUQu8AmregZI6bfm2y4kqAQuQ8LzvbmhukYT3G7xUAmyVRuoFZn1RMC2/dnHftA+iLue5vRBlAJo6pR5d4fitYl0JkA+l8EJNLcXXU9G9GbQLDHKGJ8gPpc8LtVFTsw6J/qHDmrUl7FPnDr8bvEe2PmbQCV5gTPT1O68SeAzgAwMcaUbItZqyZQiz5/nSgnP0/iWKHP0xAmGQwDq5Dso7YPgdOQtKKumc1d/R8RNUQF5dZ2nDIBmsl5zaSrQxl6QOTFWRH+VuLmgf/6H0z+y8Rnoc4+3hq6BGdIn8Qh43yP+46ZUO37mUhnFOn0jPLpNQg8TdAc7nEbyKb3leyE0Vp6wocDiaXKej7ZFeuc/Huun9UTeu/QdH0qnlnaFeVtJmN2SUoci5jQ0AaIip4MTqdv8PuCtH1WVIgzuUt+Jpfe9eziEgJy0tjmoZ3o5KQbh8 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39830400003)(376002)(346002)(366004)(396003)(6666004)(83380400001)(38350700002)(38100700002)(5660300002)(8676002)(36756003)(16526019)(2616005)(186003)(956004)(1076003)(2906002)(316002)(4326008)(6506007)(478600001)(6486002)(26005)(8936002)(6916009)(6512007)(86362001)(66946007)(52116002)(66556008)(66476007)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?kvH/kFU3f+s/l0e2ZZ2WvfuSXh/QNmw9/keLcLHIe3rgWJo4J3lw82Wkcu/8?= =?us-ascii?Q?G/4j79LSexQo/rpFxp1OV3KHHbWDEDCtdp6Nxgd4rM8L9BOAjXpWKeBOoAnh?= =?us-ascii?Q?fgDejbSkSGb5rYR9M19kT1E3aec75AmFcBkPJWrfwjQhduuexIm6oNsBIj/p?= =?us-ascii?Q?e2EJuFk+edjrWrO5yqYkwpTECLz19mYTxCSYFZB7xAUICNxuYcY6Ysi57IoI?= =?us-ascii?Q?piwolLuDa46q2zLHnff704zdh+Cbl1D+o7fHAekhsTkS1tcDs3TKPCjBSSVJ?= =?us-ascii?Q?IS+7TsDWcO+dHl7P3SPzqBZX2HdNhsilNcruL1pKjA40q7E1E13dN38TY9x5?= =?us-ascii?Q?uKlhyi5jGrhKKBAObT1R2ykMeKOHOFrtiE5oyHDttSHOYzY7CeyPEOD/MgIK?= =?us-ascii?Q?cFLSzipX0DewH0fPE81DK2JQXE5xtimiWDAOJqKdVwn8cDAgqIcz07GVznMS?= =?us-ascii?Q?PzB1Z6jayUH72ok5pmT1g1YCeOuH0Z3CkYfq8sKR2Kt1cGuIE6FMcGhzSQW3?= =?us-ascii?Q?oxqlpm88fh2t6eEp+dzGikIftIpA6rgTgLEe0frjbk1c4fXkLxUnS+lsLJ0x?= =?us-ascii?Q?1b0fAy1xRODvHcTt+XZQp4V/kBnMnnsRfcZkxm1qgIeSWw5kzgSwp9S/ka3D?= =?us-ascii?Q?slWaHTJIxrZ45pAZ3fj+hGCEghcc5BYvlP2EFaMsWDvvi5Z57mDWDpJH5pfQ?= =?us-ascii?Q?mLAI0DjY5PWOOO93KH+v+XA8q+eRpUAMek//Drr7FUNQFz5vWGv6z2KjS3UM?= =?us-ascii?Q?GcBWPz3syZNuvrFF4clf4LUEVbYl/QN4xTkg0gOnxMU79NC00zuwc/4eCZpo?= =?us-ascii?Q?sCAUadR8Qi3i+DXWCQIwoXiOM07rw8TNojhhubgSHQ8iF1UazSeMfzJcC+Mi?= =?us-ascii?Q?D4Zqh75HmvHAO2vD+0OQcfUP9FJxQ5Icj3cEkf/+YGEZgjCpsMapPKJehoYE?= =?us-ascii?Q?CAtYvK1K8rpZe21pA3DKKp1f8Eq9asSMi+v6JiCuKUCDZBB8KcvpJBskFtFo?= =?us-ascii?Q?/Hkq+GJcuOqnT4rpGbmcCcNlF1fn1BYK+oVNqSmQI3ETm5mh8hyxoKircoU6?= =?us-ascii?Q?LMytQbX3QtwLfkd8Wf9ySnO209P9Qe7qGCKdT+UCQcyxj1hZq0CpQpDyG6Rt?= =?us-ascii?Q?0wecvZyYg/D0pFEUfDb/54YDpLYW7WRhAJtF0z5cpFC2HtywiFTefHt8OV5Z?= =?us-ascii?Q?s7jWmI9+HvEf8bNPMkpgGFBH2YwqNj6XuLKjzW5wRPmTU7AtuFpVgBrkljOc?= =?us-ascii?Q?lwvGFOQdw6NuWZnqRYmIIzHmREWMO4e1Zry1eSLlxYdcAkBuy2C0gqmVEabg?= =?us-ascii?Q?JQc82ShGJtHoS8Rt+Rr7P/fU?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 40e841ac-d546-40c1-56b2-08d90ed64831 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2021 08:26:14.7783 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Uyr0vofl8CUcol+ZDVjCe2FCnBAPpqEMX63YmojghfVq7gFgRS0lurMfL6iGV8dRu85HQm9IeOtkdqs/WPtEz6RTSooQe8BFTeoRgVQCpdQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3381 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=40.107.20.116; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" Testing set/get of one 64bit variable doesn't seem necessary. We have a lot of such variables. Also remaining tests do test set/get anyway. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/unit/test-write-threshold.c | 43 ------------------------------- 1 file changed, 43 deletions(-) diff --git a/tests/unit/test-write-threshold.c b/tests/unit/test-write-thre= shold.c index bb5c1a5217..9e9986aefc 100644 --- a/tests/unit/test-write-threshold.c +++ b/tests/unit/test-write-threshold.c @@ -12,43 +12,6 @@ #include "block/write-threshold.h" =20 =20 -static void test_threshold_not_set_on_init(void) -{ - uint64_t res; - BlockDriverState bs; - memset(&bs, 0, sizeof(bs)); - - res =3D bdrv_write_threshold_get(&bs); - g_assert_cmpint(res, =3D=3D, 0); -} - -static void test_threshold_set_get(void) -{ - uint64_t threshold =3D 4 * 1024 * 1024; - uint64_t res; - BlockDriverState bs; - memset(&bs, 0, sizeof(bs)); - - bdrv_write_threshold_set(&bs, threshold); - - res =3D bdrv_write_threshold_get(&bs); - g_assert_cmpint(res, =3D=3D, threshold); -} - -static void test_threshold_multi_set_get(void) -{ - uint64_t threshold1 =3D 4 * 1024 * 1024; - uint64_t threshold2 =3D 15 * 1024 * 1024; - uint64_t res; - BlockDriverState bs; - memset(&bs, 0, sizeof(bs)); - - bdrv_write_threshold_set(&bs, threshold1); - bdrv_write_threshold_set(&bs, threshold2); - res =3D bdrv_write_threshold_get(&bs); - g_assert_cmpint(res, =3D=3D, threshold2); -} - static void test_threshold_not_trigger(void) { uint64_t threshold =3D 4 * 1024 * 1024; @@ -84,12 +47,6 @@ int main(int argc, char **argv) { size_t i; TestStruct tests[] =3D { - { "/write-threshold/not-set-on-init", - test_threshold_not_set_on_init }, - { "/write-threshold/set-get", - test_threshold_set_get }, - { "/write-threshold/multi-set-get", - test_threshold_multi_set_get }, { "/write-threshold/not-trigger", test_threshold_not_trigger }, { "/write-threshold/trigger", --=20 2.29.2 From nobody Fri Apr 26 14:03:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1620117478; cv=pass; d=zohomail.com; s=zohoarc; b=FHRfKs/RM8mmLiuLhDv3eQmnO5RKHVo1HA7Fd+BVZmRp247Q/QSBPKZ9Buhy1OdVMH+HnjbhLNBsFaSVE/0DB00iysL24d73jScMQQwiqEuj6hG4M4LoohMmixYPo5fJ0WT1LHHjz1bZ28t6Eh9cfNzraYxKeJtYmNL9seRPGCc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620117478; h=Content-Type: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; bh=RfHCf1akR3Q93h/GJZhvfAL/SN77snCpnEINBLHliLA=; b=RnBdOn6ojMCpdGqg+AR9RFWp/gT1PF5/BeddgBhN9TKHpjCx394Y3hLNPXR1g6iQ7R0+3M3FIPJSClLMGFZUCBOWEMvPtUjREDr72o/QYfPP00V+Z1CdjLAi19VUudT2yb9jh9PsMOCMXN6+ywz1hCOjxBhQ8bewN92tAIfdgIQ= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; 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; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine 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 1620117478831508.35283966225995; Tue, 4 May 2021 01:37:58 -0700 (PDT) Received: from localhost ([::1]:45596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldqZ3-00007c-PG for importer@patchew.org; Tue, 04 May 2021 04:37:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldqO8-00085m-OJ; Tue, 04 May 2021 04:26:40 -0400 Received: from mail-db8eur05on2118.outbound.protection.outlook.com ([40.107.20.118]:10464 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldqO4-0007EP-4r; Tue, 04 May 2021 04:26:40 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3381.eurprd08.prod.outlook.com (2603:10a6:20b:43::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.44; Tue, 4 May 2021 08:26:18 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4108.024; Tue, 4 May 2021 08:26:16 +0000 Received: from localhost.localdomain (185.215.60.251) by HE1P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.27 via Frontend Transport; Tue, 4 May 2021 08:26:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JR7aMqAk4AHLA9daigTgLEDXqg91Qv5wmQw56AmkuL/AYQgoQQ5K9V+SLSas/CR3+T65tg16lK9JEWWO9Kl6n+vj65+pP/3wpbxo+sVoGelp8kOWsCr/jZCXKPg9OH7jZaJUHWa76mYMPIazGrFf69OAXUYgTNZQHUXTBVPlciGEhFU0H/OjJd7tts+t0Wb0I4l6FAM1dfmG9ihzg2K5vVVboxvorlzx166GA0SfVXDGaQsxtaAkYCbZbKhIpPYw9uEG0Bya/QFM73q7Vae7n4ZH0TyJbLuRB+otjg8QaeQ7psiSuRS+KxG77EUs46ro6LX6NGl/KMU0UD88CsWlbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RfHCf1akR3Q93h/GJZhvfAL/SN77snCpnEINBLHliLA=; b=PM+bwFzjGpQUZ83XEnX90A39pvrO8EDJe/PZ5KmVk54L3Mb4ibywmJvzu5g2WlsX7whof3bHdAwrCAhDU0B9puhTo9gXkdJ0UmBoZwTjrezZ9DJAW9phXK3n4HLPL8rm02UxwsQUZUg6bjl4bgwqm+SwZa7a4RFUpjfEYRU5XWMK7Duhw0Sh/2qy6c/Ry+8CAjHr1fotLBcIFhaCUbfSC4+pCcD3G9Bcpp/FgoBUIdqYKuUxSTnKlpd/24EWu8U47P2rfWdUhFQbuGeHZN33xRiUisSQN18z3xSRcHKbS4FXt/oZi2uGzKJMvK6LmQqdQBJh1el1Z9lpS9kiIA2v+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RfHCf1akR3Q93h/GJZhvfAL/SN77snCpnEINBLHliLA=; b=Pnsm5DSXL0k/kR+ODcFt8VcY4BmV2x8oP2Hb4RIPEF5TEEFWbzlt+w4shsv+Bz+NHxs4hCUcW7xI0QOfhMzYQ2A1B4sOTXadEIQsQV42HHFEZJ9oY/E/lSQ/RAMYcPD9vQF1HauZQ+mGk2HbyXgmmnxnVSK6sIGZHsd5ku24vzQ= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, fam@euphon.net, stefanha@redhat.com, mreitz@redhat.com, kwolf@redhat.com, vsementsov@virtuozzo.com, eesposit@redhat.com, pbonzini@redhat.com Subject: [PATCH v2 7/9] test-write-threshold: drop extra TestStruct structure Date: Tue, 4 May 2021 11:25:51 +0300 Message-Id: <20210504082553.20377-8-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210504082553.20377-1-vsementsov@virtuozzo.com> References: <20210504082553.20377-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.251] X-ClientProxiedBy: HE1P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::23) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: be21d4bd-50df-4f6a-6069-08d90ed648de X-MS-TrafficTypeDiagnostic: AM6PR08MB3381: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2089; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HZ4OmdRnm772XCSaUzUijbPcw2YvAyn28TUo/Vw0w4a0ZABfA3vMuW32/wERmdruCGE3f4aAFwazDvN4YIBm7R7eNudTYQugJYvya7s22q4tfWGkDeMQ6CMetf24G5caO6IUryjA/zRLPDgyRcr2dXBpTH6vHfYZW82dRcY2lD4o3GV9AFUR0rXBm+Ocs2rVw3iw+iQU/Ch+fPZRYdTblZXDbVjpIBHI69CYFZm7O0fmxAmhdFKRmcHGl7tQT06WziuyANyNPlD/38ADqDdZw/5lEeo/ylZ0hyy//gv+YzThTp2Ot0um9ELjjMoOhqMkf/KPxt5/5aNomnf8yq0pZ3Go2wkPvKTQ/cBDGIlPJ+yNUlI0TOaHLix/sV98roJRuu6q8MzT9zpsCUyh8XnNtKpVJDwmjaMZZIWiHWPx+t+c0w2qYOULU4mcdlLO+9o8jG/UQ9ju961IqiECtEY4HQsfwucoRnWIcbG0eCXcLdXl1WjjtQgawyu/TZLdX1zT8xAwAUcZHZjPydOYDhXoxcFscYeV7S6c2L7LdDwYg+q3VlyRjr73c+ngX6E/yCSizTbsehMuUGTsMmjzuj012QlRrJnBV6RPqOJ6CAbEukz0atpF1jn2zquGCmYKCqr7Fa09GBmUCb/Dh1WvN3/A7/7z1k9i9I0tDmTYnw9yfiKdRHHhRMltYzlNqbsZ2X/s X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39830400003)(376002)(346002)(366004)(396003)(6666004)(83380400001)(38350700002)(38100700002)(5660300002)(8676002)(36756003)(16526019)(2616005)(186003)(956004)(1076003)(2906002)(316002)(4326008)(6506007)(478600001)(6486002)(26005)(8936002)(6916009)(6512007)(86362001)(66946007)(52116002)(66556008)(66476007)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?9i3CH++TMAkI9Gg6PMBQLamK2Ij3T4gi/3NKFcgGf4rOTtgFFBsuJGm2ChYB?= =?us-ascii?Q?qLSSuil42hxgP/j3JJjt5XR8GjlMkPKan943P4hSsGLU5EdSFpdg1zXyQ9pT?= =?us-ascii?Q?w2Cgk3TlHZsjIYhgCHdzST9Qs/UzBEar/E56L6kr2mTPgvpH8Im6HE2LvmQ6?= =?us-ascii?Q?//+VRs5pnNC8GEHbEnizCWeFAnOO0iBLbN6DndR6YyizrNVgPHYHoego6Ck5?= =?us-ascii?Q?MYPpIEU9GvvVmuSyzNS+CSa6qqlBfiQzPSZAj8LXV3jcR8zTbNEi2Xll4zzb?= =?us-ascii?Q?QxcJD3FE82KooGKn0LS00dpd+k0/8KreRcBqNCu+g8bZda+jecyL/Kwl9NS0?= =?us-ascii?Q?xqKT0FjjZF7lSYvGdOQ90Vo70AHTVju4wWObfLCUDw3nwkbZ9NY8aKfK6dP+?= =?us-ascii?Q?6lOc67jLwvdRClIir7SBwjLI9+gM9xKl6Ryrv5n8AlcjiXn9IFtxVLpTeDyR?= =?us-ascii?Q?100pAEoAOZ/TA9VgCW7BVj75t/+85KWj/ZbffNcOqNjaNuXxVNX7SeJns/JZ?= =?us-ascii?Q?8GXPc2NIKdKSJR8goLGPNzH/9JdgVRT7C2X891r7glg3gSkBZq12pLfHIgJj?= =?us-ascii?Q?S6Zn9ULrAdZ2PfoGoHiGQQIcmlJlTi/BMMPCsKkjbVATX2OzQmJvsZ8ZBAp3?= =?us-ascii?Q?W2r5oCJ3rnFKy4lBRbGqTkQxGTbHMeu0b+cHOY5jL1WKflBfwWeGVcj2monH?= =?us-ascii?Q?As+qDuqK9ZYPpETmDKiHsJKuymnyQIU6OAi3xRwtYGRs2nCAQmxeIsmaOO8b?= =?us-ascii?Q?cRXRUwTDVk7ldmr1/kR8953H4P+FMdYTMYdCYqFOz+BExxq/CdRiQbv8a/4j?= =?us-ascii?Q?c74sCEP9zxxLNxqi8wWECcIF7H6KnqQE114oTohmV+BZfQdjd/QlIGhkAcdp?= =?us-ascii?Q?BdiQnWzaE5yY/3/P5OsndY2Vwpd8SA6NiM74EgwIs1+Zi3DqYo0cGo0zAnmO?= =?us-ascii?Q?F3gh6z2lGZR3AgVUzoBtM9owDsHlHcQU9Pt6FJzuMami8vIepi0geFQW/xpc?= =?us-ascii?Q?IgL1hAv5ZPPlxVACitfSjscWo29lTJmNWCId4F4aL5XxUTwX7pJErawwOrdG?= =?us-ascii?Q?QCgpFXxlsM5KA6NHmpT/XGi9x6YLDLtWYkqP8AtdDgCF90oTtZRQuv4YbJuE?= =?us-ascii?Q?ieEdJjKX6OMioK3PLrQ2yu3D2ag1ePUYRBk+IiVp5m22dZGuXFp74CTTO96z?= =?us-ascii?Q?NwAnle2AkHF+7yNWFljn/j0+D+DrwDxHyA7SIsme/hd5daLuNhfHIOpdEr6u?= =?us-ascii?Q?/r1D1RFxEIU3bfX4jBOjPyJUZt+6vYTPVqyjuuR4Q5wDkDQn1kCT7n+8djXd?= =?us-ascii?Q?aGcEdooDN/TUo7hOUYG5srbU?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: be21d4bd-50df-4f6a-6069-08d90ed648de X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2021 08:26:15.9134 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: E2Twp8UldU9McEc5uL/wACRKrlgBrkuGtxAcdfEZfJxdhSYpubygpfQDdHQT0XeGWBYQOf04/sIzw62YbfUeu32nejLI2U0k1WT3CBFlGIE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3381 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=40.107.20.118; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" We don't need this extra logic: it doesn't make code simpler. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/unit/test-write-threshold.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/tests/unit/test-write-threshold.c b/tests/unit/test-write-thre= shold.c index 9e9986aefc..49b1ef7a20 100644 --- a/tests/unit/test-write-threshold.c +++ b/tests/unit/test-write-threshold.c @@ -37,26 +37,12 @@ static void test_threshold_trigger(void) g_assert_cmpuint(bdrv_write_threshold_get(&bs), =3D=3D, 0); } =20 -typedef struct TestStruct { - const char *name; - void (*func)(void); -} TestStruct; - =20 int main(int argc, char **argv) { - size_t i; - TestStruct tests[] =3D { - { "/write-threshold/not-trigger", - test_threshold_not_trigger }, - { "/write-threshold/trigger", - test_threshold_trigger }, - { NULL, NULL } - }; - g_test_init(&argc, &argv, NULL); - for (i =3D 0; tests[i].name !=3D NULL; i++) { - g_test_add_func(tests[i].name, tests[i].func); - } + g_test_add_func("/write-threshold/not-trigger", test_threshold_not_tri= gger); + g_test_add_func("/write-threshold/trigger", test_threshold_trigger); + return g_test_run(); } --=20 2.29.2 From nobody Fri Apr 26 14:03:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1620117649; cv=pass; d=zohomail.com; s=zohoarc; b=SocPJwGnrA45iaSetXrFfgcQ4+Ho1khls0dBRXk4VpnFwD99d2vGSIly9Um81OSy3IKq9Npz0OxV6dMPC7eyRnZimzSPeTjk0Z+AlbIMrBUe96Emjzti4fUMOjCH7cqGanoldq2odqc59UApa774qHZRY2tVSH+hO08qYb2aNbo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620117649; h=Content-Type: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; bh=cFkPfIwD70pGubaPVvOis8g5ycGs36T9b16u+nofoRQ=; b=S4C84YqDUyRoK3v7rHriPPTlyYAvIkELIDiQQCoEcRyE7JMjL0e4YeAc5RyUBsMiFIy+RmBjxjGo+sVXj90h5eT3v+L8wsypPWJtmgNUuzUeSe8YUXVzCZrTxH83V/LI0eSTlv4hynQ4F7N+TAYGGN/HVKISwgzMRapTcwEy+nk= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; 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; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine 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 1620117649765369.3091718281995; Tue, 4 May 2021 01:40:49 -0700 (PDT) Received: from localhost ([::1]:51444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldqbn-0002bT-8o for importer@patchew.org; Tue, 04 May 2021 04:40:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldqOB-0008DW-J0; Tue, 04 May 2021 04:26:43 -0400 Received: from mail-db8eur05on2116.outbound.protection.outlook.com ([40.107.20.116]:45350 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldqO8-0007Kk-Pm; Tue, 04 May 2021 04:26:43 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3381.eurprd08.prod.outlook.com (2603:10a6:20b:43::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.44; Tue, 4 May 2021 08:26:18 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4108.024; Tue, 4 May 2021 08:26:18 +0000 Received: from localhost.localdomain (185.215.60.251) by HE1P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.27 via Frontend Transport; Tue, 4 May 2021 08:26:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ijEc9KWH2hPg4caztXgR1cIXwh8XX0S+vikKFOSfVBo4ayJVvQD0HQ9PclLrh6PA+ikBTh3Xrm3+qH0USKYKyVvCl3+JN2JqFsZz+/unrbzHomg+Wb4UEaQrz57KPVwY7wxGBre9LTz9KY8o06xfoVFkHqDCw9K5OPk33Tp1dz5BvkSQxfExKbYgoAyxqKefNs5fWwYB49RGhxODQJTgSodhhpvXcOjzFhdl+vPefnu+ad5RkT3/i4VZmXU0gbighziolj5uF7+n5ECknzs5E2j4cHnbhSuF1qU0L0htDlf8gEf9pjZwP1+oN506mNGjCZU1NIjhWZ9wymHn495FYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cFkPfIwD70pGubaPVvOis8g5ycGs36T9b16u+nofoRQ=; b=kFXaq6SzcYBm2hhHbJILhemPT4nn3PT5Vbe5wJLvKkMqy89r9hSG1Or8UsK7eA6IFqA0jFxVwo6rsLV5b4yPcnoP2aWvT2F90FZ2gwfNAGsBV9m3IOBrN0kkFDVJHwAXNthyogRp7agO1jgzq2hIHG9D9ME/S3IyS+vpQAs2VewLYJYndqBBQDIrl8n5maRjKyiedz4Pa29OqNgXa4+YJttQq2Hl+61a2EnMMItcVZ6oFtAx9kbe1RldBnEd6KN/o4MygpiR6CRropDuqzdvEBOTZUCiRyep9H9eFEHxPbCDT2gprwbR/2VXnhyXBdzhLoEC32yWvPdL71Lv7nlxsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cFkPfIwD70pGubaPVvOis8g5ycGs36T9b16u+nofoRQ=; b=KnUwSPGjpnA8bv3/e/WfiJOC52rFWMjDaEUvUcXWl9AbXDZ/wkdS40iyKzBb7bfKNGXDx5VlaZDtMI45u4XYhGqjwKK0flAkQSkpd9NpgCBTYKD8X0uYmAZL8GZylbS3nm8S/+LiBn7z3Nf6EWzZU0Tsb07JII5GNEF/KR+CE9g= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, fam@euphon.net, stefanha@redhat.com, mreitz@redhat.com, kwolf@redhat.com, vsementsov@virtuozzo.com, eesposit@redhat.com, pbonzini@redhat.com Subject: [PATCH v2 8/9] test-write-threshold: drop extra includes Date: Tue, 4 May 2021 11:25:52 +0300 Message-Id: <20210504082553.20377-9-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210504082553.20377-1-vsementsov@virtuozzo.com> References: <20210504082553.20377-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.251] X-ClientProxiedBy: HE1P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::23) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 02787bab-0da7-4c5f-be5b-08d90ed64989 X-MS-TrafficTypeDiagnostic: AM6PR08MB3381: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:229; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ulTaELHZderJTKBIvdM21YPMWldao3y8XvYHWNvN0LO5G0K6AY8+8ZK2UMii45/O2hxaTAhkZaAl9FNrD6u14WKhfz8L6BIseQh5GrW6h/8Y3h1CFoHl5agxASEqATBrbGSLsW9aQkg2lOZT96R2w1E+WYt67RkxvYRXZiTIIHcXeIhSs7K/t99TUMf1gk6mrDwaZsXk9vXYKvTZtT0UvrZrLlUnNARt2haYF2qMcx5Nb3yJHU7hKBaWZCqKHNynO/D18GwDkDe5ZyhBIWNmQ80FVOGn95rif42f/xaKAjUAsOq+OtbZk4ihsR0fSJaF1fSzlxSu7/e4xjepsTzGqNhbQHtDzhl7REkY0JAG3YysUj2xLQ78JNHNhanvtTwEHs6zoARro7FZgiNQZpvk2K1Qe2dnEmnJauL283PzEXUlM1D/4Cm+n+OW5Y6H6ayLRBGIDAaycXY0DVfPEjmotSuYcTEAwv0KZwZFXtQmEIqiaKutMV197OLq1de8R1ASjOJ/HXpVpc3GoWtOjsge2Hi61MCUc8lQKRapiwnNOpt3vJEODtVHeJEqkHwJQNXlLV/g+wdfT33z9aBh6JHnwyWQ3eSC+Su69/3DVmZiXFBH7Pu6IWUIdYVZ+yU93WtTKI4t/VR7NicjBTWMMyzu1FnU9nOic203ONJbPnkZ84ftYMR6mY6Zp8zn7vutWaju X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39830400003)(376002)(346002)(366004)(396003)(6666004)(83380400001)(38350700002)(38100700002)(5660300002)(8676002)(36756003)(16526019)(2616005)(186003)(4744005)(956004)(1076003)(2906002)(316002)(4326008)(6506007)(478600001)(6486002)(26005)(8936002)(6916009)(6512007)(86362001)(66946007)(52116002)(66556008)(66476007)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?MPprQMy6EJ9KKV9c90mX5DdtuxuST2QzaB3lpUbXBFYnIUgnoe76fsEGArAQ?= =?us-ascii?Q?jAg0V0IluHSPh0hj4X0irPMEwSNohWb5DGJXFMUlvuPw1si4mGEEZ2FJRa65?= =?us-ascii?Q?2XlTa5q18GySsrzpYaT1oVx7YborSPxFe/pCjdxPb2xANsYPhazuHT3Hjt8I?= =?us-ascii?Q?g9JmV1wZcEOKwRXIcPf9/TGdzMC88dg9HFeRwsyrg99HlyAsIbS5ub32Zw1F?= =?us-ascii?Q?LYBG7iCB+ptKj9DzFvm8rcAP6tugVIvENUzAlA/lCa8n6zI9WDNv4vkTYi3/?= =?us-ascii?Q?q0S3re5DojDDjyCofHvsd3LgGGECBybSl1Pyk7vHnzL2d+fdoh6vlyADw24D?= =?us-ascii?Q?RctEZTHAaNHiseK1892XQwSsSNF1Bg61rum+o/jUADfrQWgenk5ONXdMrmRZ?= =?us-ascii?Q?kv4tDfA/W1A5riHnqSoegLywra8CRtxiiJDs/iiDPGNai4TdUBMs6ISBCFaI?= =?us-ascii?Q?ZtKbjQd1Sxmru+JQyYJTidu6sVXOLEvp04Eh9khvNzRroFaJVrVZs4lrnzZG?= =?us-ascii?Q?iemf8lVe06T/Tyn4eagKFtb3jaCSOvsXBTuQVRz1KNqxguekZNXGheB9Cc5b?= =?us-ascii?Q?iraXI0f3UjXruK9QbopjE97dvtvFnFg+JhFuUnC/5SJTAiq1jUynrPd5VxpF?= =?us-ascii?Q?5G0eyD18U9+cozkea+Atk3n88W/khgbJBcFce0v3MK4BlB8Kn/ssIu6QbGHr?= =?us-ascii?Q?ZkYHZCj0jKh+Xqg3FqUw7jDz1oZwhsJNc07XTR6fl0HG4Ltn8jm4H45/WJXl?= =?us-ascii?Q?0qBnmwOkaqDA0i/YYa+kkPKvuUYwUlejh0DWSqQ/XPAXjVLXuBXZnO99KgtG?= =?us-ascii?Q?Dkiw0HmoKHPpKsSZLvh/bIiIBq4RpGdwiuLwBapPutF0YkHv+wNDwEfQGIZo?= =?us-ascii?Q?neHlERIqIBGUzXMlCAr5JBi4WH2/70B00xLeH40szUINEizYJCfwZmqOjcEL?= =?us-ascii?Q?ZaOQmPlP7RW+oG6bO1lTWpmatjYzZnHm5yWmr3s2clGJI9S9J9F8627F2Dv9?= =?us-ascii?Q?9XGwRiOm81Y/1Es7EUuVRXBvM/wYqQ9aFECwNfGOEpgPtJd3YtpJR00MZ6SX?= =?us-ascii?Q?Jt+Pd8MjeyF1p8dXzOIFfPQfjyRePTZNKY1PHopU0VKa1likNreqjizk75/H?= =?us-ascii?Q?Hq+LRmI/fluRK8z0kEw54d0pzbG52R+fHDswNDHogmvRWFu6ykb9jGGIZ42u?= =?us-ascii?Q?gQHLiEbC3r7bDDEudvfMjeIE/sfP2ywcvmSZdvctjMRo65nUHicZyAbtZfqV?= =?us-ascii?Q?SzK3vnm3mHeYm1oJHI0AXkcjEHJUNESIKb68/0ldJ1wCJaLmRWg4VCUI0Bm3?= =?us-ascii?Q?FVdfsnvntl0g+pnqyhUHwOl9?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 02787bab-0da7-4c5f-be5b-08d90ed64989 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2021 08:26:17.0962 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: YPGs2q2AELcTfKJ1TlrhhF1gqR7hzicq3Njk0UZ2WOBFsk9J/u8/DtXqTivj7SmKLJJVWrrnk8+P7rbGs50KzFSHQ7PAmUFsgNEsNdZSZHM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3381 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=40.107.20.116; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/unit/test-write-threshold.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/unit/test-write-threshold.c b/tests/unit/test-write-thre= shold.c index 49b1ef7a20..761054eab2 100644 --- a/tests/unit/test-write-threshold.c +++ b/tests/unit/test-write-threshold.c @@ -7,8 +7,6 @@ */ =20 #include "qemu/osdep.h" -#include "qapi/error.h" -#include "block/block_int.h" #include "block/write-threshold.h" =20 =20 --=20 2.29.2 From nobody Fri Apr 26 14:03:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1620117659; cv=pass; d=zohomail.com; s=zohoarc; b=YKoMaHzFqYNYNlrPfG7xVhudU+emj8umjDmi/vnyFr1G/9GBwZzwM9lyauxirjdQhRCom8IbZYlrJ1b4WDw58+kONwtmj6FAAZ+8+jtCTaer6sRXXYjaK5xV0BVTCiwrC04vEq0twuwsUFe9fdHqOlylH87bIMDD9lvPoauWViI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620117659; h=Content-Type: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; bh=8q1oNd1d5R+Mo2I2ztKGqDFJlKnbfwaxcMLfeS819TU=; b=FlYcBLy6Cw1pmCXzZVildC5xyysX4Ku3EtGdqXgZSM9LdOpJzOxJU7RkUkbeHr8CSEdKpMFtmzXtyLXAFb5+qTOPKootugHoTIpL1/sZ9fLEo8FT0Fg1f9NZPDICZ+CX2exTwp7I1JXptrIjd838X3yNynEDJv9ZlC4o9sqrQtc= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; 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; arc=pass (i=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine 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 1620117659287192.89400630700766; Tue, 4 May 2021 01:40:59 -0700 (PDT) Received: from localhost ([::1]:51644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldqby-0002hq-85 for importer@patchew.org; Tue, 04 May 2021 04:40:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldqOC-0008Fo-EL; Tue, 04 May 2021 04:26:44 -0400 Received: from mail-db8eur05on2118.outbound.protection.outlook.com ([40.107.20.118]:10464 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldqO9-0007EP-BB; Tue, 04 May 2021 04:26:44 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3381.eurprd08.prod.outlook.com (2603:10a6:20b:43::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.44; Tue, 4 May 2021 08:26:19 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4108.024; Tue, 4 May 2021 08:26:19 +0000 Received: from localhost.localdomain (185.215.60.251) by HE1P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.27 via Frontend Transport; Tue, 4 May 2021 08:26:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YOZMqwWUfDZB+MnMpXO6on1e1SJpBe6qyyKEnpRrdU7boStHVKtG2/+SLz29ATE7OAtA/y7QdrZPFI5A1g/FnhXtqH2piZ3G3w2ISnXWNFXtAB543cHQW5diWkaOa/bBXNzy8S5NAbUxJRfDMZ+1bWdduAkICAz7ihq4v3nUnF4vdsIjjrKd5mLnDyHAJqSPkJ+gnPYiFcuXolEU3h2ryHWpFYKwqIfQ2zeR6PrrATD+57ywsxCJeYU0mwr980Fpa0CUejV/Nv9N07C4sAZf/CGZ6UweKYS2P6h20miWNJ2lMO9rxNOqCrIIBJRG3tfgHdH1TnCJCDTKNrurxRPB9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8q1oNd1d5R+Mo2I2ztKGqDFJlKnbfwaxcMLfeS819TU=; b=QvP4uddZ57yzYwALjJnr1xjC01IA038hptzznjiXI+ewYdzS9O7g7U4JqfidYlEJWssybtM9fTorGC1VsdkJJfwgfb4USRAsHkJQaUnNs5+8AkbqGMopoa2f1m2lkY0AMLJtysQk6TJnfbzrz5Cx2xY8QNXohG3a1KUDNu/GqEdELblhgDJcNyjtXbbvTZAYv8kn5usbI4S8S/nADKvrv1EdFHf2XmcYVBeTr8PrwGJjsdh7/NPR584aG8lg7fU3tQjPwSg7r5HNBKCihpmkU8d4Y78/0hROLjWAR/LMf7XF8lF6UM5Pi7Uwt41itWk8Kv4gio36d7c+vm120sxYZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8q1oNd1d5R+Mo2I2ztKGqDFJlKnbfwaxcMLfeS819TU=; b=U94OK8jMqj5tDI/9o32QVzm4ima8VKeHXksOhKlQPjwUGHwTNzrzaoeqG92OLvapFSvf2FDhItco9AB0puyRYqT5iaBjfCXkuLWjXL6dTUlZVMlrHV/vlN059oCuu8M2j1jvs8v9j2ONO6VTL5Tm/dWPL/OEgBK0oIWpAeo2/IQ= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, fam@euphon.net, stefanha@redhat.com, mreitz@redhat.com, kwolf@redhat.com, vsementsov@virtuozzo.com, eesposit@redhat.com, pbonzini@redhat.com Subject: [PATCH v2 9/9] block/write-threshold: drop extra includes Date: Tue, 4 May 2021 11:25:53 +0300 Message-Id: <20210504082553.20377-10-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210504082553.20377-1-vsementsov@virtuozzo.com> References: <20210504082553.20377-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.251] X-ClientProxiedBy: HE1P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::23) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f75f80d8-d389-4259-0474-08d90ed64a6d X-MS-TrafficTypeDiagnostic: AM6PR08MB3381: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:229; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q8YgM5WYurCOCtLDmx0lY81v6xTyij3uw072/2hIhP8DLRbOMoSIzY83aApK/RLivBbcjIP6bbrtLGorfyoCHoueQ8uzv5rQfEIhPAHGBwycpyitb/vdwUpGRpE62i1u/6RayMA7YPOS66rUH317uGzQo6D3u8EVw3pjfD0DjMTatxG/NbOcgdhfDSfhCgi73dQYDJxA1X/EpwMcriZ4cOdeFkawbw77+D576fcPyrR9CuFepyj75sX7M8HRSXsN+9krlLmwbnYD715loc8LsClbXWNK3L6jl3avm8d9zoC4qwrYiGBJoyp6fmLH4XNzySxoGu7vdRMKd9pI6saCpY7EBojri1Nn52gsn9iQltwkcQnu361R8FgHE/P//uv5Gtkv9uPVWhwBmRAhQ7vmpDCAdWAWd7Og4UjVe1T00HDUsT+yu0WP3csfetQw6BBHBk8Jkk8VttryoG/P34nmuoGfs5tY5zK+ITNY7M6uFDiabvhDhDZdNVWwfl1sAu+ath0SsxnLkIaoawmUWToSE6O1kyZyoClRlU2Qi0/9CuzfDSuWHWfZ3zpP4fdiapDeVu1nVnVkC32ZoIyM6ICMFWkpUeE6cRu5thaG/UD7HGbto12BQGabITTD6AigDgX4YKcHS7PtH/gc/W6cIan64nQosN/2TieypXqFZBmdgEyh1uNgSEaJBwR5deQybza/ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39840400004)(376002)(346002)(366004)(396003)(6666004)(83380400001)(38350700002)(38100700002)(5660300002)(8676002)(36756003)(16526019)(2616005)(186003)(4744005)(956004)(1076003)(2906002)(316002)(4326008)(6506007)(478600001)(6486002)(26005)(8936002)(6916009)(6512007)(86362001)(66946007)(52116002)(66556008)(66476007)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?PgMQnnd913F7zj6irA8AqBghvzmW+TAxmAUreRFgQaf+Sfn4at+WK8OkL0A4?= =?us-ascii?Q?bE2UUmbpQ0AJ5ahmOPhsro5YKDdPqprSUdKI/W1XIL+ixGioXN3fbh7cpwzp?= =?us-ascii?Q?/H2iAl8RG8gFzgdOzfdUNdfvk4PYX7hpuLXwTZeyWcjtG56mwCkMRfrFqjg4?= =?us-ascii?Q?JB3hHBNz7j+snKyPclEPkDuRUfYuo2EsT+0ll35IKHtrEWI/lI6IjtmPdFMm?= =?us-ascii?Q?g1yErZWhB/6Hy0RLyWnn0OWlA/ehizmZ7bfRw8MaTIh/EVny4JrgAN23NCLJ?= =?us-ascii?Q?7RON+zbXiOQfiNF5jKe4HJ3Fwlb8rcsQgE9IjWqORJGYskjejDu3GvGZ6DhZ?= =?us-ascii?Q?Eh+WBV5WhLrUMGzviYTp3k2IwECUXFZcep60X3a1u2AQ9VnK3q8IYmY0yGib?= =?us-ascii?Q?mYlX+8McG3gOWOYSyx3+bv1oTg/GIMJ+zDX/NkBnCH/XpJ3CgHQGdfESVh++?= =?us-ascii?Q?ERBDqmXlMcN0hwNJLN+tlwydrPPhQAXxs98ouZkDzC+NUeJ/pnnGvNcFlcnF?= =?us-ascii?Q?4q31wDq/xgbF6tRcwtukryAbUqHdn2goM9F6sW2nBD5/7v5dcICZDcRrB6mN?= =?us-ascii?Q?NaW4t+YZs2XbVhIAKEZV1eQ9Ar98Ajue0O8wPfqp2tS74kbIav2kskmouK2i?= =?us-ascii?Q?x7L7dznPCZ9fRKmh4LdhTj7XpoFOqv8Zu5Z0ivUT9QxjRa6rhrUUxd8qJOMq?= =?us-ascii?Q?IdPnUPB9QG2D+sEyddoP2VCgg1VTEuf+ELGupEj4m+EHjK3H3gpepoYc3Db3?= =?us-ascii?Q?Np5Aom0ve3Wa8DKtWRUabejMccmfR+bAIwRpWqOiryXDlOk7SnmHOrrI8jvM?= =?us-ascii?Q?439rg3Ai5ZpdwSR+20otLxeAsuTxG6mNP9vksYtyhq3sMvecyQcmQicfBbiH?= =?us-ascii?Q?vKhfKctnpx4M0dpc5GU9a28XmapBvxKOMmbnQU+d5U7RT3tV4pXsWBcQFEHO?= =?us-ascii?Q?60K77LTL6dDugOx5uUGRm/4jyHFegq7zmyTO/fVs8q4YDzUxvTIZw0vSNq3b?= =?us-ascii?Q?GlUIjcwLlh6eOMG9E1teo3P6vRfDxorI9SRc4ri1AIhTWpqD4uarwqFO82ct?= =?us-ascii?Q?syzWkmvAjFUuaH4JMX1LRYCzzInAWeiOkxIwQG6HseuZT6cdSHPj6noroEMx?= =?us-ascii?Q?+E8H0KaO4IpC80tzIC/ENhpxFYPWeHkk1pJ6NEzpGQxv9/U2oz7ps+uKl83J?= =?us-ascii?Q?ddvja4AmVuhiC4UkdO+JcCkqZiBEi0QZ2q/TFqohWtbvxhckMwpqyMV59GnC?= =?us-ascii?Q?9JmtUZxe34zbohtaoGPTXBEK+oVVAeIUasirdJ/lBFqINOvFHaqiXnqpd++8?= =?us-ascii?Q?5rXCJyahQLtUP1NWq3BDo/iV?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: f75f80d8-d389-4259-0474-08d90ed64a6d X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2021 08:26:18.6036 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fTznG36iakgGEXBy/Yk0Pt3OzWJ1XQG+X3DJST6zQNrYvyzZTN0e54Ke2JTm/75efA+lrP2r4BZBJH3Ycy0IzjBtaNomclXfcReAEIyAJDw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3381 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=40.107.20.118; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/write-threshold.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/block/write-threshold.c b/block/write-threshold.c index fbf4e6f5c4..db271c5537 100644 --- a/block/write-threshold.c +++ b/block/write-threshold.c @@ -12,10 +12,7 @@ */ =20 #include "qemu/osdep.h" -#include "block/block_int.h" -#include "qemu/coroutine.h" #include "block/write-threshold.h" -#include "qemu/notify.h" #include "qapi/error.h" #include "qapi/qapi-commands-block-core.h" #include "qapi/qapi-events-block-core.h" --=20 2.29.2