qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] block: Fix iotests 059
@ 2017-01-19 13:07 Fam Zheng
  2017-01-19 13:07 ` [Qemu-devel] [PATCH 1/2] qapi: Tweak error message of bdrv_query_image_info Fam Zheng
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Fam Zheng @ 2017-01-19 13:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Markus Armbruster, Kevin Wolf, Max Reitz, qemu-block

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

-- 
2.9.3

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH 1/2] qapi: Tweak error message of bdrv_query_image_info
  2017-01-19 13:07 [Qemu-devel] [PATCH 0/2] block: Fix iotests 059 Fam Zheng
@ 2017-01-19 13:07 ` Fam Zheng
  2017-01-21 19:33   ` Max Reitz
  2017-01-19 13:07 ` [Qemu-devel] [PATCH 2/2] iotests: Fix reference output for 059 Fam Zheng
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Fam Zheng @ 2017-01-19 13:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Markus Armbruster, Kevin Wolf, Max Reitz, qemu-block

@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>
---
 block/qapi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/qapi.c b/block/qapi.c
index a62e862..6329735 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -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;
     }
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH 2/2] iotests: Fix reference output for 059
  2017-01-19 13:07 [Qemu-devel] [PATCH 0/2] block: Fix iotests 059 Fam Zheng
  2017-01-19 13:07 ` [Qemu-devel] [PATCH 1/2] qapi: Tweak error message of bdrv_query_image_info Fam Zheng
@ 2017-01-19 13:07 ` Fam Zheng
  2017-01-19 14:30 ` [Qemu-devel] [PATCH 0/2] block: Fix iotests 059 Eric Blake
  2017-01-21 19:35 ` Max Reitz
  3 siblings, 0 replies; 6+ messages in thread
From: Fam Zheng @ 2017-01-19 13:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Markus Armbruster, Kevin Wolf, Max Reitz, qemu-block

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.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/qemu-iotests/059.out | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out
index 678adb4..19bd50d 100644
--- a/tests/qemu-iotests/059.out
+++ b/tests/qemu-iotests/059.out
@@ -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
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH 0/2] block: Fix iotests 059
  2017-01-19 13:07 [Qemu-devel] [PATCH 0/2] block: Fix iotests 059 Fam Zheng
  2017-01-19 13:07 ` [Qemu-devel] [PATCH 1/2] qapi: Tweak error message of bdrv_query_image_info Fam Zheng
  2017-01-19 13:07 ` [Qemu-devel] [PATCH 2/2] iotests: Fix reference output for 059 Fam Zheng
@ 2017-01-19 14:30 ` Eric Blake
  2017-01-21 19:35 ` Max Reitz
  3 siblings, 0 replies; 6+ messages in thread
From: Eric Blake @ 2017-01-19 14:30 UTC (permalink / raw)
  To: Fam Zheng, qemu-devel
  Cc: Kevin Wolf, Markus Armbruster, qemu-block, Max Reitz

[-- Attachment #1: Type: text/plain, Size: 518 bytes --]

On 01/19/2017 07:07 AM, Fam Zheng wrote:
> 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
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

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

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] qapi: Tweak error message of bdrv_query_image_info
  2017-01-19 13:07 ` [Qemu-devel] [PATCH 1/2] qapi: Tweak error message of bdrv_query_image_info Fam Zheng
@ 2017-01-21 19:33   ` Max Reitz
  0 siblings, 0 replies; 6+ messages in thread
From: Max Reitz @ 2017-01-21 19:33 UTC (permalink / raw)
  To: Fam Zheng, qemu-devel; +Cc: Markus Armbruster, Kevin Wolf, qemu-block

[-- Attachment #1: Type: text/plain, Size: 1212 bytes --]

On 19.01.2017 14:07, Fam Zheng wrote:
> @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>
> ---
>  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

> diff --git a/block/qapi.c b/block/qapi.c
> index a62e862..6329735 100644
> --- a/block/qapi.c
> +++ b/block/qapi.c
> @@ -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;
>      }
>  
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH 0/2] block: Fix iotests 059
  2017-01-19 13:07 [Qemu-devel] [PATCH 0/2] block: Fix iotests 059 Fam Zheng
                   ` (2 preceding siblings ...)
  2017-01-19 14:30 ` [Qemu-devel] [PATCH 0/2] block: Fix iotests 059 Eric Blake
@ 2017-01-21 19:35 ` Max Reitz
  3 siblings, 0 replies; 6+ messages in thread
From: Max Reitz @ 2017-01-21 19:35 UTC (permalink / raw)
  To: Fam Zheng, qemu-devel; +Cc: Markus Armbruster, Kevin Wolf, qemu-block

[-- Attachment #1: Type: text/plain, Size: 446 bytes --]

On 19.01.2017 14:07, Fam Zheng wrote:
> 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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-21 19:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-19 13:07 [Qemu-devel] [PATCH 0/2] block: Fix iotests 059 Fam Zheng
2017-01-19 13:07 ` [Qemu-devel] [PATCH 1/2] qapi: Tweak error message of bdrv_query_image_info Fam Zheng
2017-01-21 19:33   ` Max Reitz
2017-01-19 13:07 ` [Qemu-devel] [PATCH 2/2] iotests: Fix reference output for 059 Fam Zheng
2017-01-19 14:30 ` [Qemu-devel] [PATCH 0/2] block: Fix iotests 059 Eric Blake
2017-01-21 19:35 ` Max Reitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).