Received: from eggs.gnu.org ([2001:4830:134:3::10]:56975) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj5AJ-0004s9-5X for qemu-devel@nongnu.org; Fri, 17 Apr 2015 08:14:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yj5AE-0001mj-S5 for qemu-devel@nongnu.org; Fri, 17 Apr 2015 08:14:35 -0400 From: Alberto Garcia In-Reply-To: <1429271563-3765-1-git-send-email-berto@igalia.com> References: <1429271563-3765-1-git-send-email-berto@igalia.com> Date: Fri, 17 Apr 2015 14:14:28 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH] qmp: fill in the image field in BlockDeviceInfo List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-block@nongnu.org, Stefan Hajnoczi On Fri 17 Apr 2015 01:52:43 PM CEST, Alberto Garcia wrote: > Anyone calling bdrv_block_device_info() directly will get a null image > field. As a consequence of this, the HMP command 'info block -n -v' > crashes QEMU. > > This patch moves the code that fills in that field from > bdrv_query_info() to bdrv_block_device_info(). And in case this change is too big/risky for 2.3, there's also the simple workaround for the crash: --- a/hmp.c +++ b/hmp.c @@ -391,7 +391,7 @@ static void print_block_info(Monitor *mon, BlockInfo *info, inserted->iops_size); } - if (verbose) { + if (verbose && inserted->image) { monitor_printf(mon, "\nImages:\n"); image_info = inserted->image; while (1) { Berto