From patchwork Mon Jan 28 14:27:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Kuchin X-Patchwork-Id: 10783823 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 46D1791E for ; Mon, 28 Jan 2019 14:38:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26A572AFFA for ; Mon, 28 Jan 2019 14:38:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 131912B005; Mon, 28 Jan 2019 14:38:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BE0732AFFA for ; Mon, 28 Jan 2019 14:38:15 +0000 (UTC) Received: from localhost ([127.0.0.1]:32991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1go83D-000795-39 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 28 Jan 2019 09:38:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1go7tZ-0000Sa-7z for qemu-devel@nongnu.org; Mon, 28 Jan 2019 09:28:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1go7tY-0006Il-H0 for qemu-devel@nongnu.org; Mon, 28 Jan 2019 09:28:17 -0500 Received: from forwardcorp1g.cmail.yandex.net ([87.250.241.190]:53193) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1go7tW-00064w-Dv; Mon, 28 Jan 2019 09:28:14 -0500 Received: from mxbackcorp2j.mail.yandex.net (mxbackcorp2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::119]) by forwardcorp1g.cmail.yandex.net (Yandex) with ESMTP id 05F002184C; Mon, 28 Jan 2019 17:28:11 +0300 (MSK) Received: from smtpcorp1p.mail.yandex.net (smtpcorp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:10]) by mxbackcorp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id n3Wr1N4PxP-SAWiTQdT; Mon, 28 Jan 2019 17:28:10 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1548685690; bh=9k//rVLHkrk812DNqWUbqREUJX8gspBSgFAdZa1pgxQ=; h=From:To:Cc:Subject:Date:Message-Id; b=IK+pwnJxSco55NUvgQyrC6PPWdz6mUcirnaf9yJh//ENms1KBp5UkVTD3l0FafTLd 0FV97mEy1NaWf/noObACcGkKoZFDUQq4Mo8sN3LsF5ANZZ/JXKNU2e1Ei8yTVn9PCi WIVVPLfYWO37YU7utxfel8R9XXUwCGCZS/1ORX1E= Authentication-Results: mxbackcorp2j.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from dynamic-red.dhcp.yndx.net (dynamic-red.dhcp.yndx.net [2a02:6b8:0:408:250:b6ff:fe97:2682]) by smtpcorp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id S7ZFtr57gZ-SA5O8cPb; Mon, 28 Jan 2019 17:28:10 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) From: Anton Kuchin To: qemu-devel@nongnu.org Date: Mon, 28 Jan 2019 17:27:46 +0300 Message-Id: <20190128142748.29140-1-antonkuchin@yandex-team.ru> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 87.250.241.190 Subject: [Qemu-devel] [PATCH 0/2] block: add blk_lookup() for getting device by node_name X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, Markus Armbruster , "Dr. David Alan Gilbert" , Anton Kuchin , Max Reitz , Evgeny Yakovlev Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Some HMP and QMP commands are targeting BlockBackend but for hotplugged devices name of BB is deprecated, instead name of root BlockDriverState is set. These patches add functions to search BB by attached root BDS name. This approach isn't perfect, but I couldn't invent a better one and I belive it's more convinient than accessing BB by QOM path. Anton Kuchin (2): block: add functions to search BlockBackend by root BDS name block: migrate callers from blk_by_name to blk_lookup block/block-backend.c | 29 +++++++++++++++++++++++++++++ blockdev-nbd.c | 2 +- blockdev.c | 6 +++--- hmp.c | 2 +- include/sysemu/block-backend.h | 7 +++++++ 5 files changed, 41 insertions(+), 5 deletions(-)