diff options
author | Max Reitz <mreitz@redhat.com> | 2014-05-31 21:33:30 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2014-06-02 13:58:40 +0200 |
commit | 55d492d7602c27cabb605f42e72c755de1c186c1 (patch) | |
tree | 1c90b78b99d3d768ec9b2de274abaa8f4bce56f2 /qemu-img.c | |
parent | c13959c745a7e4965c94d19e3153d2c44459906d (diff) |
qemu-img: Report error even with --oformat=json
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>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qemu-img.c')
-rw-r--r-- | qemu-img.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/qemu-img.c b/qemu-img.c index d118da5c2f..b3d2bc6f02 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; goto fail; } |