From nobody Sat Feb 7 10:14:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=virtuozzo.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1645832641559930.0033932422405; Fri, 25 Feb 2022 15:44:01 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-55-VeytoN8qOmSK_vGGQWxh9w-1; Fri, 25 Feb 2022 18:43:58 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9275A1091DA1; Fri, 25 Feb 2022 23:43:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1B67692A9C; Fri, 25 Feb 2022 23:43:53 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7A7544ED28; Fri, 25 Feb 2022 23:43:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21PNhn9M027576 for ; Fri, 25 Feb 2022 18:43:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3CD6940CFD18; Fri, 25 Feb 2022 23:43:49 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3777F40CFD01 for ; Fri, 25 Feb 2022 23:43:49 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 165BE101AA46 for ; Fri, 25 Feb 2022 23:43:49 +0000 (UTC) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80095.outbound.protection.outlook.com [40.107.8.95]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-486-FFCf8lN9OgSPCSAN8Knbog-4; Fri, 25 Feb 2022 18:43:45 -0500 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by DB8PR08MB4172.eurprd08.prod.outlook.com (2603:10a6:10:af::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21; Fri, 25 Feb 2022 23:43:37 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714%3]) with mapi id 15.20.5017.021; Fri, 25 Feb 2022 23:43:37 +0000 X-MC-Unique: VeytoN8qOmSK_vGGQWxh9w-1 X-MC-Unique: FFCf8lN9OgSPCSAN8Knbog-4 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v3 03/11] block: make bdrv_find_child() function public Date: Sat, 26 Feb 2022 00:43:00 +0100 Message-ID: <20220225234308.1754763-4-vsementsov@virtuozzo.com> In-Reply-To: <20220225234308.1754763-1-vsementsov@virtuozzo.com> References: <20220225234308.1754763-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: VE1PR03CA0006.eurprd03.prod.outlook.com (2603:10a6:802:a0::18) 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: f4f47ab1-c2b1-4fdb-c878-08d9f8b8a4a5 X-MS-TrafficTypeDiagnostic: DB8PR08MB4172:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: vH8+llE34uG+DW/1kDUXd8oP7a8jB+WeA6d8WL5PKIQJzKzVvSbzLJtcM/71GYD7Vk9Cofa114JX3+p+aOSsbr2HliAFB/tXdz0Sgao7ml7GCUfVNFlPtEdUlDJhr4NeJ8mhLlhbmoZj9OKuPDEE26LT1qwLtfU5tvb5eENXtGg0ahsY7IEWkBoW5WevbbYQygxMbJB0Vy7tkif7R5yVdw4Vn/dPT4ppsKDuvbQ5LkaEQeahEihPHaUIPjzRP+1Zz4RCUZr3i/wYJqV0dyiP0ihePpUBXohjjEYNLzXQkzfNMcIE1DMuGNn3HkmY+cDO91261PbxxLzd+t+iLeHUJHJdKS9Fv7tPowo3B2j1/ckKMFGOCsf3adLBsBDZbs7ba7tRuZfxn/NIOVNaDygFopUHAwz1ioVWMGn1Sn+AvDdkYKMf2GcUl7vrdJhqVygXDlaiQ5wIJejiUipZ5tV5C3TvxmUx4nb4143Ya22ulMDKF4aFdAx4/W3S3fxmsiaOB1F2Bg6IVWPma+CwPi+fj0+xlTOCbMa3gCw2kG4s4mU8HFLHqX3IYuGg4GrAe+qWtNkXyEbUmY+xXLb07uAnBg0Nn30W/G/ppXsST1B6XBzoGwl8mFlEkSfbbq268Nb748PY7Y/QyPuZkppwuX2zPG6HAgHiq4eQWorKA2xW+11aQj18O/61qG9HwCWM8b3ucFkZYxOX2wXYYWhN8XzC4Q== 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:(13230001)(4636009)(366004)(6916009)(6506007)(8676002)(66556008)(5660300002)(83380400001)(6666004)(7416002)(8936002)(52116002)(508600001)(6486002)(6512007)(2616005)(26005)(316002)(36756003)(38350700002)(1076003)(38100700002)(2906002)(86362001)(4326008)(186003)(66946007)(66476007); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?W1TaHpwM0MDw6mG6SsuqLDlnPd0rNWtHRw9FZno5p2rycsiwtXuBzNx6zfSa?= =?us-ascii?Q?ojA0gbKq/b8NmfjvUgrifsvwj7gR2dFOq/H5ngs6IcQxWbsSlP0WYe7pThvf?= =?us-ascii?Q?Zb6EnDTGSAFxT0RELMSjWrzbTkYY0nI/cckoP+8/H7IEzAHrxE3q8F5k2Tdx?= =?us-ascii?Q?y3epENHpnqr/pYB5ibItIN8GgzfYJuBHl0veUfbSrE30fGwUKth9zppF5lnm?= =?us-ascii?Q?Pwinlex9Gn85zC7Tv7TZk9d+VJjyU92AoqPLomSBX3EqhjO9pjxqqbDpJUG9?= =?us-ascii?Q?MnJOcEinBB2TbySS9Z9wd8J6VbkCBKANTG2yIKdQcE31J3qUj+4UQmzSzjPY?= =?us-ascii?Q?J5SEv7u1NYaiyEySP6DKtthdwWXREYBq0UQHovSZJ+ZIFsn0dAayrvStsuag?= =?us-ascii?Q?Qb7jnQ4rFCg0Ty9cP4PKnOZsjALe+L7viTETpnbOVZWH4X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aPcX3GgAy5MtvXq8N8PM3szlWf2beq5QaDvEwpuP1ABzgTZUwgNM?= =?us-ascii?Q?LoTUlp2tIvF5alEYUfluzFV+2AUaSs9q6Y3dE+Ed3sR0MA2IZOl5d3VuHVgf?= =?us-ascii?Q?ztl052sYcjQzw29FPGLZXjbocIUKe80/iYHNxY8pOmdSHyIN8dRRKtYy3SwJ?= =?us-ascii?Q?ezRaCk9UbzWONrGE+2QF6ef7ZZBYMTpw2ptieECR1+8B1Wvbo7TCTtxSEi96?= =?us-ascii?Q?eKW1TqKfzG2EzsqHgDR8ZA2FrMgUCvmpxh15ipRHbkUoE0/JHL9He48fwW/u?= =?us-ascii?Q?6wBcceSHUTI2Pns1YYStDKzG8RG1CtLQKvARMpWD0j75Z1cNcUbt5AZ9g0Tl?= =?us-ascii?Q?xA1haz0nAEtKU09yhcC86XSBz08=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: f4f47ab1-c2b1-4fdb-c878-08d9f8b8a4a5 X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2022 23:43:37.0884 (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: mVqb0fzLqsNPQAb3nWABFmG9NGbelaAGJ94E9eiYb1c0CPGNPHQvjEb4D0VAB5fJH3jwSNkEDFPfuON7ucjIkVI4FTC2U7NQ7mgxukicz3Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4172 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 21PNhn9M027576 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, libvir-list@redhat.com, dim@virtuozzo.com, igor@virtuozzo.com, qemu-devel@nongnu.org, armbru@redhat.com, hreitz@redhat.com, pkrempa@redhat.com, yur@virtuozzo.com, nshirokovskiy@virtuozzo.com, stefanha@redhat.com, den@openvz.org, pbonzini@redhat.com, eblake@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1645832645056100002 Content-Type: text/plain; charset="utf-8" To be reused soon. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block_int.h | 1 + block.c | 13 +++++++++++++ blockdev.c | 14 -------------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index 27008cfb22..e44348e851 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -1430,6 +1430,7 @@ BdrvDirtyBitmap *block_dirty_bitmap_remove(const char= *node, const char *name, BlockDriverState **bitmap_bs, Error **errp); =20 +BdrvChild *bdrv_find_child(BlockDriverState *parent_bs, const char *child_= name); BdrvChild *bdrv_cow_child(BlockDriverState *bs); BdrvChild *bdrv_filter_child(BlockDriverState *bs); BdrvChild *bdrv_filter_or_cow_child(BlockDriverState *bs); diff --git a/block.c b/block.c index b54d59d1fa..601fee163b 100644 --- a/block.c +++ b/block.c @@ -7728,6 +7728,19 @@ int bdrv_make_empty(BdrvChild *c, Error **errp) return 0; } =20 +BdrvChild *bdrv_find_child(BlockDriverState *parent_bs, const char *child_= name) +{ + BdrvChild *child; + + QLIST_FOREACH(child, &parent_bs->children, next) { + if (strcmp(child->name, child_name) =3D=3D 0) { + return child; + } + } + + return NULL; +} + /* * Return the child that @bs acts as an overlay for, and from which data m= ay be * copied in COW or COR operations. Usually this is the backing file. diff --git a/blockdev.c b/blockdev.c index eb9ad9cb89..d20963be2a 100644 --- a/blockdev.c +++ b/blockdev.c @@ -3661,20 +3661,6 @@ out: aio_context_release(aio_context); } =20 -static BdrvChild *bdrv_find_child(BlockDriverState *parent_bs, - const char *child_name) -{ - BdrvChild *child; - - QLIST_FOREACH(child, &parent_bs->children, next) { - if (strcmp(child->name, child_name) =3D=3D 0) { - return child; - } - } - - return NULL; -} - void qmp_x_blockdev_change(const char *parent, bool has_child, const char *child, bool has_node, const char *node, Error **errp) --=20 2.31.1