From patchwork Mon Mar 2 11:36:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 445071 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id DB3331400DE for ; Mon, 2 Mar 2015 22:37:49 +1100 (AEDT) Received: from localhost ([::1]:56378 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSOfU-0005N6-34 for incoming@patchwork.ozlabs.org; Mon, 02 Mar 2015 06:37:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51745) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSOev-0004DH-IL for qemu-devel@nongnu.org; Mon, 02 Mar 2015 06:37:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSOeg-0000xZ-70 for qemu-devel@nongnu.org; Mon, 02 Mar 2015 06:37:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44931) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSOeg-0000xO-0G for qemu-devel@nongnu.org; Mon, 02 Mar 2015 06:36:58 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t22Bav4E000547 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 2 Mar 2015 06:36:57 -0500 Received: from ad.nay.redhat.com (dhcp-14-137.nay.redhat.com [10.66.14.137]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t22BapvS003213; Mon, 2 Mar 2015 06:36:55 -0500 From: Fam Zheng To: qemu-devel@nongnu.org Date: Mon, 2 Mar 2015 19:36:46 +0800 Message-Id: <1425296209-1476-2-git-send-email-famz@redhat.com> In-Reply-To: <1425296209-1476-1-git-send-email-famz@redhat.com> References: <1425296209-1476-1-git-send-email-famz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , Markus Armbruster , Stefan Hajnoczi , Max Reitz Subject: [Qemu-devel] [PATCH 1/4] monitor: Convert bdrv_find to blk_by_name X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Fam Zheng Reviewed-by: Max Reitz --- monitor.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index 41900da..6ad777d 100644 --- a/monitor.c +++ b/monitor.c @@ -72,6 +72,7 @@ #include "block/qapi.h" #include "qapi/qmp-event.h" #include "qapi-event.h" +#include "sysemu/block-backend.h" /* for hmp_info_irq/pic */ #if defined(TARGET_SPARC) @@ -5413,15 +5414,15 @@ int monitor_read_block_device_key(Monitor *mon, const char *device, BlockCompletionFunc *completion_cb, void *opaque) { - BlockDriverState *bs; + BlockBackend *blk; - bs = bdrv_find(device); - if (!bs) { + blk = blk_by_name(device); + if (!blk) { monitor_printf(mon, "Device not found %s\n", device); return -1; } - return monitor_read_bdrv_key_start(mon, bs, completion_cb, opaque); + return monitor_read_bdrv_key_start(mon, blk_bs(blk), completion_cb, opaque); } QemuOptsList qemu_mon_opts = {