From nobody Tue Feb 10 00:58:55 2026 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=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1638563343; cv=pass; d=zohomail.com; s=zohoarc; b=Ukr5sFEcaG/WGnzYbUUdcF+ZrICXthBjydZ2hnOQIPHqKkRHnaMYFpw8OXXtZqDJa2O9lZqG/JYSnrJHNrmiPjZculpGrAV4+Fw38yJBj+insmk3B7+EqZXFWROsr1oUfZIHu7YSOhDYb0Q7Aa4etHnjzY/5K1CllL5VfuBUoA0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638563343; 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=8Y9LPTxEfEll8hr7ZfNbGMzDqY1ke2XkpUh154uh+aE=; b=kilsc96fljjjapb6MHzWa6kKAyKPty7bHsgIjRHtXIVCVuIM+pN0t/F8Kt31hipO58NT7eQ3clDEg5EL2XO5aSWZGKLL59KGvHfQ0O8zLHrPkT+YDb0Drdyw2VYDAYZSFij8zz1vf66nIxTbneBirHkWk0QMTkl6AXeQEnNmuFE= 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=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1638563342976528.1870725824358; Fri, 3 Dec 2021 12:29:02 -0800 (PST) Received: from localhost ([::1]:58346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtFAz-0003sv-Hx for importer@patchew.org; Fri, 03 Dec 2021 15:29:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtF8j-0000mO-0d; Fri, 03 Dec 2021 15:26:42 -0500 Received: from mail-eopbgr150139.outbound.protection.outlook.com ([40.107.15.139]:14661 helo=EUR01-DB5-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 1mtF8V-0001cv-2m; Fri, 03 Dec 2021 15:26:30 -0500 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by AM0PR08MB3841.eurprd08.prod.outlook.com (2603:10a6:208:106::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.22; Fri, 3 Dec 2021 20:26:17 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::2078:5a2:1898:d83a]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::2078:5a2:1898:d83a%7]) with mapi id 15.20.4669.024; Fri, 3 Dec 2021 20:26:17 +0000 Received: from kvm.ch-qa.sw.ru (130.117.225.5) by AM6PR10CA0086.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:8c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.16 via Frontend Transport; Fri, 3 Dec 2021 20:26:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CLxBFoyV1HVSDnho8fAMai/2hhjAZS8BJFBg8wHCGS9qRNlV8jz9HAZiCaVGm4D9e5vhNWJLXmeG9Kdqd3k2OXaRsq5hQQTXKWvJJcMdw6QuBCtWLlxbXXVSFkgB3fIkaoGj9jPNpUvlOXhrvD4nzNwGE6nBJ5QwJ0F9t0re6odGpNd2EYKvz4z3Y7o4bSMwpKI9QfDCV8nrkzP/I1ZtpMRXAGXZbLHraRHM9cOkFA91qedgd/+fs7kPl0aa13fUjPIm3hvsyHnhZKrTfYHFD4Y3MgUWnHknKHspQZeDraaC/ydFwxj8Pf4KaTMCGyNfAPJVJfh3Ia8P//nLtQqbJg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8Y9LPTxEfEll8hr7ZfNbGMzDqY1ke2XkpUh154uh+aE=; b=cKcMabTEvhX+w0UEr0kE9fwZJZtnDIRG/gMFz7dLd85cWrakiv/nokubIjWv8o8mLQQJhJCX8CGsuq5m35djRXOa9URzNJrjUW0OeoUJyTzb4kdUnapddVhd5Du8I9JrsAn9iovCHw7OQV05pP3jJ1F53pn/pqI/FpeAKjLihOGZ8MW4zDCPORZCt7/uBI8aH6Fpz/InAIWzpRrTlVqkYCsK7kzowZeud55ktSnkW0FWtgf6K3mqix4ogyrri2AYc1FlxcDu8YjpjDoGKESx0XROOD25xA5oc6Gqq/OCugttOueC1l9EfyMPBUYKc311gcty0lEHfr3NSpYwXm+UeA== 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=8Y9LPTxEfEll8hr7ZfNbGMzDqY1ke2XkpUh154uh+aE=; b=WlvN+8N6dL+ozIJGdFPEyKCnqJUAl5ulMSsYw/UM+0BHKTzdEgFwxnpoPtXdcpM9Wsu0jMVdbgzDjzLE1kcOgkFzgpx7rsfKjzyYRm+2PX2R+1WDgqE/T8/ECm5MeWYKpAcO5Mxx2qzPEQo8AftCjdIBxSQgo8dCPpEHgrk3V3k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, kwolf@redhat.com, hreitz@redhat.com, vsementsov@virtuozzo.com, John Snow Subject: [PATCH 01/14] block: BlockDriver: add .filtered_child_is_backing field Date: Fri, 3 Dec 2021 21:25:40 +0100 Message-Id: <20211203202553.3231580-2-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211203202553.3231580-1-vsementsov@virtuozzo.com> References: <20211203202553.3231580-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AM6PR10CA0086.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:8c::27) To AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a94453e4-788a-4d52-16cb-08d9b69b2889 X-MS-TrafficTypeDiagnostic: AM0PR08MB3841: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3276; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KhlXKqJDc8yYES/XTQ8YHeXM77U4M6F5xuhgN243mXcNyDeSK/hkCFfaBDfPiVdHkHrbNzyW/l6wBbv8/gD2B3nxthuVc6eDmyxVQRZV+z0DtAoNK8NMH66wLAZrSahneUlUBSasmDYbVRauI01YPbbMyjnxp2HIOqwRUtBQjQDnSXq5kFPoj5A5EPpau87Nf0eJDKqvOf/uQiPAxHJg+c2vSvi96CQ2P74+j8JPttjfLymLhp2pxMvvB8ZBnOmXQDFa263il8h7nVnORjnDBYjPJb/OWE/vmTFeYOIah0n0oPZ1qmKO23GP+l/47YFKYVc6B6RSl6N/u+Uu1H3luBkQZ+vxRidwhtsNT6XvHRy5F5Y15vNkqiG2T+TMVtnwgfsvngL3kEj/URlVPfN2Ca2Ylo1w7nAdQY79m7DZAOy/Wd/RYP4b3knxjK+nlpzjnxxRPWvxefmK41kLtFpxmuCPFvYvuUtoLcA/Ty8fEU1zd5VRuKOuKYzT81RIeCo6NqIRlZHm4p8RjnxijkXGh8wSYeivj4/g+nRZJCDa/LRQC4xtNhLmNE3wNM8dHQJgHapCEWZ2HAlVopgm9TIRf5PXLwRJJZ74CXvEhS90uYc1QIRUtMbuItCqFRpXbjYeyuEJO1O8ItU+XCQqJla+LXHR2bUKLcD8jDvVCUnOsUNrP9DT3pNPOr4sspSKhm2iMYlUJPigkuX2VbLB2tlTFbfZCTcwC8y2WVSr8oQpwkM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB6737.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(186003)(86362001)(2906002)(2616005)(6506007)(6916009)(1076003)(66946007)(26005)(36756003)(6666004)(66556008)(6512007)(52116002)(38100700002)(83380400001)(38350700002)(8936002)(8676002)(5660300002)(508600001)(4326008)(6486002)(316002)(956004)(66476007)(142923001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Msmb5Vaht9DYDc1D8wF/Ur0Qqx5SjOHMnu1dupCOQGUAyzge7F3E11jhAJDw?= =?us-ascii?Q?mvEMcI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0fKbtKM2?= =?us-ascii?Q?DVx/aTqXUQ0bqFLm7VfVP6Qxyfb8kYkLMSo6gi1mvBl3/tpW9TvGCl8pMy/O?= =?us-ascii?Q?rCHf9VqRxNj7KPmbj986l4oaFskSnsm0993VT+ZPViO9WmqHkk7KND4mKgYA?= =?us-ascii?Q?8ypduYBblAQUyyapp8kxKT+yuYbAm4JS/8dK/E9cZAy7CfiPjolBmMjvUZ0V?= =?us-ascii?Q?s6jbCDB1JpeMxhFKtQDRTBgByOKN0SIYIiEWdsZvhPiepF6YYJ5k8nNGNIyT?= =?us-ascii?Q?LZTDlVWOyPe6MzCwXi4q0BP6ugcn+1uGPV9xLGfXBcCBYSvF9zltunSD5jWB?= =?us-ascii?Q?s4p82Ubd35+8EQYvIKaf/NHyAwn1DNIWVzEb6wTZqrkp3Lm2wx2468hmYNje?= =?us-ascii?Q?uFsln9+xXB65wh4wtelqY1T2BqvRMPJSv3ch464a7x7bVYSAKzvlWO2njI+/?= =?us-ascii?Q?hr8XFvKTrn7pyg6vsHzFo6jGScVY+7VJJm7Xv+MlnzCReOZLLbtvlTbN/BSH?= =?us-ascii?Q?w9UYSINsmXv0uyyQXsa4YSqCtQQJ65RFaWR+jTgiMomBNdoo/ozqQLUQ56Ct?= =?us-ascii?Q?uwyULW/tgnyhB620+h+n+ahQmuHfH8qO0mBH7kWGs5ck8hUwaNY3Thio9otE?= =?us-ascii?Q?V10M/WIf4y98Z88wnjJa24r9UnCghCFRgtNAPyjBc6QI1IKKFHY4kbWHYM2n?= =?us-ascii?Q?K+9oD7Hzj2yFLSs54q3eJSNIjsAlbHp2LMIKkFT50SOBofr1vcB4+EbdJgYW?= =?us-ascii?Q?2kxkWYEhkJ1Jrpmjx5L5G3G8Two=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a94453e4-788a-4d52-16cb-08d9b69b2889 X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2021 20:26:17.2356 (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: ax04YpyCKa8/J5c6bMC8pauNiJPBOwaqLRZBqMjUCvCkZiyg9hIpj+tikPxVbfjNs8VgNdndwoMFWkli6ZjeM26IoKifa8UFXOHr8sAbRTg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3841 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.15.139; envelope-from=vsementsov@virtuozzo.com; helo=EUR01-DB5-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.29 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) X-ZM-MESSAGEID: 1638563345212100001 Content-Type: text/plain; charset="utf-8" Unfortunately not all filters use .file child as filtered child. Two exclusions are mirror_top and commit_top. Happily they both are private filters. Bad thing is that this inconsistency is observable through qmp commands query-block / query-named-block-nodes. So, could we just change mirror_top and commit_top to use file child as all other filter driver is an open question. Probably, we could do that with some kind of deprecation period, but how to warn users during it? For now, let's just add a field so we can distinguish them in generic code, it will be used in further commits. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block_int.h | 14 ++++++++++++++ block/commit.c | 1 + block/mirror.c | 1 + 3 files changed, 16 insertions(+) diff --git a/include/block/block_int.h b/include/block/block_int.h index f4c75e8ba9..9c06f8816e 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -117,6 +117,20 @@ struct BlockDriver { * (And this filtered child must then be bs->file or bs->backing.) */ bool is_filter; + + /* + * Only make sense for filter drivers, for others must be false. + * If true, filtered child is bs->backing. Otherwise it's bs->file. + * Only two internal filters use bs->backing as filtered child and has= this + * field set to true: mirror_top and commit_top. + * + * Never create any more such filters! + * + * TODO: imagine how to deprecate this behavior and make all filters w= ork + * similarly using bs->file as filtered child. + */ + bool filtered_child_is_backing; + /* * Set to true if the BlockDriver is a format driver. Format nodes * generally do not expect their children to be other format nodes diff --git a/block/commit.c b/block/commit.c index 10cc5ff451..23d60aebf4 100644 --- a/block/commit.c +++ b/block/commit.c @@ -237,6 +237,7 @@ static BlockDriver bdrv_commit_top =3D { .bdrv_child_perm =3D bdrv_commit_top_child_perm, =20 .is_filter =3D true, + .filtered_child_is_backing =3D true, }; =20 void commit_start(const char *job_id, BlockDriverState *bs, diff --git a/block/mirror.c b/block/mirror.c index efec2c7674..22e2b7b110 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1587,6 +1587,7 @@ static BlockDriver bdrv_mirror_top =3D { .bdrv_child_perm =3D bdrv_mirror_top_child_perm, =20 .is_filter =3D true, + .filtered_child_is_backing =3D true, }; =20 static BlockJob *mirror_start_job( --=20 2.31.1