提交 638b8366 编写于 作者: A Alberto Garcia 提交者: Peter Maydell

hmp: fix crash in 'info block -n -v'

The image field in BlockDeviceInfo should never be null, however
bdrv_block_device_info() is not filling it in.

This makes the 'info block -n -v' command crash QEMU.

The proper solution is probably to move the relevant code from
bdrv_query_info() to bdrv_block_device_info(), but since we're too
close to the release for that this simpler workaround solves the
crash.
Signed-off-by: NAlberto Garcia <berto@igalia.com>
Message-id: 1429274688-8115-1-git-send-email-berto@igalia.com
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
上级 87a8adc0
......@@ -391,7 +391,8 @@ static void print_block_info(Monitor *mon, BlockInfo *info,
inserted->iops_size);
}
if (verbose) {
/* TODO: inserted->image should never be null */
if (verbose && inserted->image) {
monitor_printf(mon, "\nImages:\n");
image_info = inserted->image;
while (1) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册