summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-08-08 15:21:33 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-08-08 15:21:33 +0100
commitb8dc0fcff10702ab38db2d318f8fa2b8fc5c61b0 (patch)
treecd5e7e1214f1c96ac16af8021d79495fba869190 /hw
parent684b6b26af02a58692bb98578ff2653cd60dcb9c (diff)
parenta752e4786c19b0b368f4521a5dcbcce14882c3b1 (diff)
downloadqemu-b8dc0fcff10702ab38db2d318f8fa2b8fc5c61b0.tar.gz
qemu-b8dc0fcff10702ab38db2d318f8fa2b8fc5c61b0.tar.bz2
qemu-b8dc0fcff10702ab38db2d318f8fa2b8fc5c61b0.zip
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
More block layer patches for 2.7.0-rc2 # gpg: Signature made Mon 08 Aug 2016 12:51:30 BST # gpg: using RSA key 0x7F09B272C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6 * remotes/kevin/tags/for-upstream: iotests: fix 109 mirror: finish earlier on error tests: Test blockjob IDs block/qdev: Let 'drive' property fall back to node name Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/core/qdev-properties-system.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index 2ba2504ea0..e55afe6bf2 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -126,7 +126,16 @@ static void release_drive(Object *obj, const char *name, void *opaque)
static char *print_drive(void *ptr)
{
- return g_strdup(blk_name(ptr));
+ const char *name;
+
+ name = blk_name(ptr);
+ if (!*name) {
+ BlockDriverState *bs = blk_bs(ptr);
+ if (bs) {
+ name = bdrv_get_node_name(bs);
+ }
+ }
+ return g_strdup(name);
}
static void get_drive(Object *obj, Visitor *v, const char *name, void *opaque,