qemu-img: Report error even with --oformat=json
commit55d492d7602c27cabb605f42e72c755de1c186c1
authorMax Reitz <mreitz@redhat.com>
Sat, 31 May 2014 19:33:30 +0000 (31 21:33 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 2 Jun 2014 11:58:40 +0000 (2 13:58 +0200)
tree1c90b78b99d3d768ec9b2de274abaa8f4bce56f2
parentc13959c745a7e4965c94d19e3153d2c44459906d
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>
qemu-img.c