aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlberto Garcia <berto@igalia.com>2015-04-17 14:52:43 +0300
committerKevin Wolf <kwolf@redhat.com>2015-04-28 15:36:09 +0200
commitd5a8ee60a0fbc20a2c2d02f3bda1bb1bd365f1ee (patch)
tree7755e310e852704dbb2022a426d94e23bae02d4b /include
parent9419874f709469de16c1bced7731bfecb07fe1cf (diff)
downloadqemu-d5a8ee60a0fbc20a2c2d02f3bda1bb1bd365f1ee.zip
qemu-d5a8ee60a0fbc20a2c2d02f3bda1bb1bd365f1ee.tar.gz
qemu-d5a8ee60a0fbc20a2c2d02f3bda1bb1bd365f1ee.tar.bz2
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>
Diffstat (limited to 'include')
-rw-r--r--include/block/block.h2
-rw-r--r--include/block/qapi.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/block/block.h b/include/block/block.h
index b285e0d..d79714a 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -382,7 +382,7 @@ void bdrv_lock_medium(BlockDriverState *bs, bool locked);
void bdrv_eject(BlockDriverState *bs, bool eject_flag);
const char *bdrv_get_format_name(BlockDriverState *bs);
BlockDriverState *bdrv_find_node(const char *node_name);
-BlockDeviceInfoList *bdrv_named_nodes_list(void);
+BlockDeviceInfoList *bdrv_named_nodes_list(Error **errp);
BlockDriverState *bdrv_lookup_bs(const char *device,
const char *node_name,
Error **errp);
diff --git a/include/block/qapi.h b/include/block/qapi.h
index 168d788..327549d 100644
--- a/include/block/qapi.h
+++ b/include/block/qapi.h
@@ -29,7 +29,7 @@
#include "block/block.h"
#include "block/snapshot.h"
-BlockDeviceInfo *bdrv_block_device_info(BlockDriverState *bs);
+BlockDeviceInfo *bdrv_block_device_info(BlockDriverState *bs, Error **errp);
int bdrv_query_snapshot_info_list(BlockDriverState *bs,
SnapshotInfoList **p_list,
Error **errp);