From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXYKv-0003br-RI for qemu-devel@nongnu.org; Mon, 16 Mar 2015 12:57:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXYKo-0002A4-24 for qemu-devel@nongnu.org; Mon, 16 Mar 2015 12:57:53 -0400 From: Kevin Wolf Date: Mon, 16 Mar 2015 17:57:13 +0100 Message-Id: <1426525041-21926-10-git-send-email-kwolf@redhat.com> In-Reply-To: <1426525041-21926-1-git-send-email-kwolf@redhat.com> References: <1426525041-21926-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 09/17] monitor: Convert bdrv_find to blk_by_name List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Fam Zheng Signed-off-by: Fam Zheng Message-id: 1425296209-1476-2-git-send-email-famz@redhat.com Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- monitor.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index c86a89e..8b703f9 100644 --- a/monitor.c +++ b/monitor.c @@ -73,6 +73,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) @@ -5414,15 +5415,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 = { -- 1.8.3.1