From: Max Reitz <mreitz@redhat.com>
To: Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>,
Kevin Wolf <kwolf@redhat.com>,
qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] qapi: Tweak error message of bdrv_query_image_info
Date: Sat, 21 Jan 2017 20:33:36 +0100 [thread overview]
Message-ID: <90f814f3-20a5-9e4e-a045-76efbde8d455@redhat.com> (raw)
In-Reply-To: <20170119130759.28319-2-famz@redhat.com>
[-- 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 --]
next prev parent reply other threads:[~2017-01-21 19:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=90f814f3-20a5-9e4e-a045-76efbde8d455@redhat.com \
--to=mreitz@redhat.com \
--cc=armbru@redhat.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).