* Re: [Qemu-devel] [PATCH] qemu-img: Report error even with --oformat=json
[not found] <1401564810-18798-1-git-send-email-mreitz@redhat.com>
@ 2014-06-02 5:30 ` Markus Armbruster
2014-06-02 11:59 ` Kevin Wolf
1 sibling, 0 replies; 2+ messages in thread
From: Markus Armbruster @ 2014-06-02 5:30 UTC (permalink / raw)
To: Max Reitz; +Cc: Kevin Wolf, Federico Simoncelli, qemu-devel, Stefan Hajnoczi
Max Reitz <mreitz@redhat.com> writes:
> img_check() should report that the format of the given image does not
> support checks even if JSON output is desired. JSON data is output to
> stdout, as opposed to error messages, which are (in the case of
> qemu-img) printed to stderr. Therefore, it is easy to distinguish
> between the two.
>
> Also, img_info() does already use error_report() for human-readable
> messages even though JSON output is desired (through
> collect_image_info_list()).
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
> As the old code deliberately emitted the error only in case of
> human-readable output, I asked Federico, the original author, for his
> opinion in https://bugzilla.redhat.com/show_bug.cgi?id=1054753, but did
> not receive a reply so far.
> ---
> qemu-img.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/qemu-img.c b/qemu-img.c
> index d118da5..b3d2bc6 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -663,9 +663,7 @@ static int img_check(int argc, char **argv)
> ret = collect_image_check(bs, check, filename, fmt, fix);
>
> if (ret == -ENOTSUP) {
> - if (output_format == OFORMAT_HUMAN) {
> - error_report("This image format does not support checks");
> - }
> + error_report("This image format does not support checks");
> ret = 63;
Undocumented return code. Care to fix that, too?
> goto fail;
> }
Reviewed-by: Markus Armbruster <armbru@redhat.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] qemu-img: Report error even with --oformat=json
[not found] <1401564810-18798-1-git-send-email-mreitz@redhat.com>
2014-06-02 5:30 ` [Qemu-devel] [PATCH] qemu-img: Report error even with --oformat=json Markus Armbruster
@ 2014-06-02 11:59 ` Kevin Wolf
1 sibling, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2014-06-02 11:59 UTC (permalink / raw)
To: Max Reitz; +Cc: Federico Simoncelli, qemu-devel, Stefan Hajnoczi
Am 31.05.2014 um 21:33 hat Max Reitz geschrieben:
> img_check() should report that the format of the given image does not
> support checks even if JSON output is desired. JSON data is output to
> stdout, as opposed to error messages, which are (in the case of
> qemu-img) printed to stderr. Therefore, it is easy to distinguish
> between the two.
>
> Also, img_info() does already use error_report() for human-readable
> messages even though JSON output is desired (through
> collect_image_info_list()).
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-06-02 11:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1401564810-18798-1-git-send-email-mreitz@redhat.com>
2014-06-02 5:30 ` [Qemu-devel] [PATCH] qemu-img: Report error even with --oformat=json Markus Armbruster
2014-06-02 11:59 ` Kevin Wolf
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).