qemu-img: add check for zero-length job len
commit62547b8a1c04daf30f50e3db362ade53e22bf222
authorJohn Snow <jsnow@redhat.com>
Mon, 2 Nov 2015 23:28:20 +0000 (2 18:28 -0500)
committerKevin Wolf <kwolf@redhat.com>
Wed, 11 Nov 2015 15:25:47 +0000 (11 16:25 +0100)
tree459afde597d4e97dae7996bafcc77aad92b4e5d2
parent95334230637cef9fbd199bb79a56271ec73d4732
qemu-img: add check for zero-length job len

The mirror job doesn't update its total length until
it has already started running, so we should translate
a zero-length job-len as meaning 0%.

Otherwise, we may get divide-by-zero faults.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-img.c