qapi: Tweak error message of bdrv_query_image_info

@bs doesn't always have a device name, such as when it comes from
"qemu-img info". Report file name instead.

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 20170119130759.28319-2-famz@redhat.com
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
Fam Zheng 2017-01-19 21:07:58 +08:00 committed by Max Reitz
parent 6b33f3ae8b
commit 9adceb0213

View File

@ -237,8 +237,8 @@ void bdrv_query_image_info(BlockDriverState *bs,
size = bdrv_getlength(bs);
if (size < 0) {
error_setg_errno(errp, -size, "Can't get size of device '%s'",
bdrv_get_device_name(bs));
error_setg_errno(errp, -size, "Can't get image size '%s'",
bs->exact_filename);
goto out;
}