]> git.proxmox.com Git - mirror_qemu.git/commit - block/qapi.c
qmp: fill in the image field in BlockDeviceInfo
authorAlberto Garcia <berto@igalia.com>
Fri, 17 Apr 2015 11:52:43 +0000 (14:52 +0300)
committerKevin Wolf <kwolf@redhat.com>
Tue, 28 Apr 2015 13:36:09 +0000 (15:36 +0200)
commitd5a8ee60a0fbc20a2c2d02f3bda1bb1bd365f1ee
tree7755e310e852704dbb2022a426d94e23bae02d4b
parent9419874f709469de16c1bced7731bfecb07fe1cf
qmp: fill in the image field in BlockDeviceInfo

The image field in BlockDeviceInfo is supposed to contain an ImageInfo
object. However that is being filled in by bdrv_query_info(), not by
bdrv_block_device_info(), which is where BlockDeviceInfo is actually
created.

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().

Signed-off-by: Alberto Garcia <berto@igalia.com>
Message-id: 1429271563-3765-1-git-send-email-berto@igalia.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
block/qapi.c
blockdev.c
include/block/block.h
include/block/qapi.h