Skip to contentSkip to conversation

block: Fix iotests 059

PATCH Applied Fam Zheng 3 participants 6 messages Jan 19, 2017 – Jan 21, 2017 Block layer

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

cover block: Fix iotests 059

The 059.out went out of sync, bring it back in line.

Fam Zheng (2):
qapi: Tweak error message of bdrv_query_image_info
iotests: Fix reference output for 059

 block/qapi.c               | 4 ++--
 tests/qemu-iotests/059.out | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.9.3
author
#1 lore raw

PATCH 1/2 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.

---
 block/qapi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
block/qapi.c +2 -2
index a62e862..6329735 100644
@@ -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;
     }
 
Signature · 1 line
2.9.3
#2 lore raw

Re: [Qemu-devel] [PATCH 1/2] qapi: Tweak error message of bdrv_query_image_info

Quoted 7 lines · Fam Zheng

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

---
 block/qapi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Yes, I had a discussion with Kevin whether we should add some function like bdrv_error_setg() which automatically prepends some description™ of a BDS (e.g. node name if user-set, or device name if meaningful, or filename if not JSON). Spoiler: We probably should.

This is fine for now, though, because this function specifically deals with images.

Max

Quoted 16 lines
block/qapi.c +2 -2
index a62e862..6329735 100644
@@ -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;
     }
 
author
#3 lore raw

PATCH 2/2 iotests: Fix reference output for 059

In reply to Fam Zheng

It was broken by efaa7c4eeb7 when it dropped the device name "image" from BB API. Now this error message text is updated again, sync it up.

---
 tests/qemu-iotests/059.out | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests/059.out +1 -1
index 678adb4..19bd50d 100644
@@ -2361,5 +2361,5 @@ Offset          Length          Mapped to       File
 0x140000000     0x10000         0x50000         TEST_DIR/iotest-version3-s003.vmdk
 
 === Testing afl image with a very large capacity ===
-qemu-img: Can't get size of device 'image': File too large
+qemu-img: Can't get image size 'TEST_DIR/afl9.IMGFMT': File too large
 *** done
Signature · 1 line
2.9.3
Reviewed-by on the v1 series
#4 lore raw
In reply to Fam Zheng
Quoted 6 lines · Fam Zheng

The 059.out went out of sync, bring it back in line.

Fam Zheng (2):
qapi: Tweak error message of bdrv_query_image_info
iotests: Fix reference output for 059

Quoted 4 lines
 block/qapi.c               | 4 ++--
 tests/qemu-iotests/059.out | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Applied
#5 lore raw
In reply to Fam Zheng
Quoted 9 lines · Fam Zheng

The 059.out went out of sync, bring it back in line.

Fam Zheng (2):
qapi: Tweak error message of bdrv_query_image_info
iotests: Fix reference output for 059

 block/qapi.c               | 4 ++--
 tests/qemu-iotests/059.out | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Thanks, applied to my block tree:

https://github.com/XanClic/qemu/commits/block

Max