From nobody Mon Feb 2 07:31:22 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; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1768834233; cv=none; d=zohomail.com; s=zohoarc; b=cMqBCAnAiS0ZB8g8yJpyhy6tXYpoojpT8/X9sv2vPWucjQ4c0YHUfgDGT2kRdwVf+DhuHTTWNsXSGwBgQ/q1vnaD84oaGnvyLJfqJqpbuEd2GlAHDfTpW6FGVTQu4BurI+FrvGLoTSRIW6rY6Vn5HeoIAidTvgcD/YdLQVrZPUk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768834233; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lXRrptFlJe5HYpQfYVtYh/snqUvBJmv+mKkgz5B5lJ0=; b=VZIyUEh1JvKhjmt4fDpGiIapLmvhONhSailIXQYbobTKSeaA3pC4uzLobMR1xFTuvBpgn8UaaSOr0256LUEPMfjsyVdJuDMmsvteRoxG/UI6F+sTN5ctNvC5ENMbnFkYx235seXB+oY3qM9kUZUXDUY8Q1+qFBWsFjjBzJLABos= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1768834232391388.38532523938557; Mon, 19 Jan 2026 06:50:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vhqZx-0008GN-6a; Mon, 19 Jan 2026 09:50:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vhqZm-0008Cj-LQ; Mon, 19 Jan 2026 09:49:57 -0500 Received: from forwardcorp1a.mail.yandex.net ([2a02:6b8:c0e:500:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vhqZi-0008NI-F0; Mon, 19 Jan 2026 09:49:54 -0500 Received: from mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:5a81:0:640:624e:0]) by forwardcorp1a.mail.yandex.net (Yandex) with ESMTPS id 09354C015A; Mon, 19 Jan 2026 17:49:46 +0300 (MSK) Received: from vsementsov-lin (unknown [2a02:6bf:8080:934::1:38]) by mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id gnaGbV0CCKo0-rU9v1UQW; Mon, 19 Jan 2026 17:49:45 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1768834185; bh=lXRrptFlJe5HYpQfYVtYh/snqUvBJmv+mKkgz5B5lJ0=; h=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From; b=bgne+6IKMT1TLPu+XL3yyTUC5ac3xG7KlqSLDtErkDuvioxCBiX19jRksLlhddMsO cAekfRvEN7UQI9e0xHLbdAdxZcMPVe7cIt/vyl11lc808BBXI434YXIEqM1oQenqTk cTchKVQQhCHxa5PuIRjQ5jrPOi+1lIcVlN1icbXM= Authentication-Results: mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, eduardo@habkost.net, berrange@redhat.com, pbonzini@redhat.com, armbru@redhat.com, eblake@redhat.com, devel@lists.libvirt.org, hreitz@redhat.com, kwolf@redhat.com, vsementsov@yandex-team.ru Subject: [PATCH v10 2/8] block/export: add blk_by_export_id() Date: Mon, 19 Jan 2026 17:49:35 +0300 Message-ID: <20260119144941.87936-3-vsementsov@yandex-team.ru> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260119144941.87936-1-vsementsov@yandex-team.ru> References: <20260119144941.87936-1-vsementsov@yandex-team.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (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=2a02:6b8:c0e:500:1:45:d181:df01; envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1a.mail.yandex.net 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1768834238839154100 Content-Type: text/plain; charset="utf-8" We need it for further blockdev-replace functionality. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/export/export.c | 15 +++++++++++++++ include/system/block-backend-global-state.h | 1 + 2 files changed, 16 insertions(+) diff --git a/block/export/export.c b/block/export/export.c index f3bbf11070..d11beb900f 100644 --- a/block/export/export.c +++ b/block/export/export.c @@ -370,3 +370,18 @@ BlockExportInfoList *qmp_query_block_exports(Error **e= rrp) =20 return head; } + +BlockBackend *blk_by_export_id(const char *id, Error **errp) +{ + BlockExport *exp; + + exp =3D blk_exp_find(id); + if (exp =3D=3D NULL) { + error_setg(errp, "Export '%s' not found", id); + return NULL; + } + + assert(exp->blk); + + return exp->blk; +} diff --git a/include/system/block-backend-global-state.h b/include/system/b= lock-backend-global-state.h index a438f21dff..f23b9f1518 100644 --- a/include/system/block-backend-global-state.h +++ b/include/system/block-backend-global-state.h @@ -72,6 +72,7 @@ void blk_detach_dev(BlockBackend *blk, DeviceState *dev); DeviceState *blk_get_attached_dev(BlockBackend *blk); BlockBackend *blk_by_dev(void *dev); BlockBackend *blk_by_qdev_id(const char *id, Error **errp); +BlockBackend *blk_by_export_id(const char *id, Error **errp); void blk_set_dev_ops(BlockBackend *blk, const BlockDevOps *ops, void *opaq= ue); =20 int blk_make_zero(BlockBackend *blk, BdrvRequestFlags flags); --=20 2.52.0