qemu-img: Print error if check failed
commit832390a5ed11e6c516db0986bf302d098e3ae36c
authorMax Reitz <mreitz@redhat.com>
Thu, 23 Oct 2014 13:29:12 +0000 (23 15:29 +0200)
committerMax Reitz <mreitz@redhat.com>
Thu, 23 Oct 2014 17:42:07 +0000 (23 19:42 +0200)
tree5bc56db7d132bb7007d7ee3c664e7e7c558275c3
parent3cad83075c7b847fe0eb6e61316fdf50984d4570
qemu-img: Print error if check failed

Currently, if bdrv_check() fails either by returning -errno or having
check_errors set, qemu-img check just exits with 1 after having told the
user that there were no errors on the image. This is bad.

Instead of printing the check result if there were internal errors which
were so bad that bdrv_check() could not even complete with 0 as a return
value, qemu-img check should inform the user about the error.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
qemu-img.c