Kevin Wolf d40593dd90 block/backup: Fix hang for unaligned image size
When doing a block backup of an image with an unaligned size (with
respect to the BACKUP_CLUSTER_SIZE), qemu would check the allocation
status of sectors after the end of the image. bdrv_is_allocated()
returns a result that is valid for 0 sectors in this case, so the backup
job ran into an endless loop.

Stop looping when seeing a result valid for 0 sectors, we're at EOF then.

The test case looks somewhat unrelated at first sight because I
originally tried to reproduce a different suspected bug that turned out
to not exist. Still a good test case and it accidentally found this one.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2014-07-09 15:50:11 +02:00
..
2014-06-02 16:28:59 +02:00
2013-10-28 17:34:42 +01:00
2014-05-28 14:47:35 +01:00
2014-05-05 20:58:33 +02:00
2014-05-27 23:42:16 +03:00
2012-03-12 15:14:07 +01:00
2014-02-14 16:22:33 +01:00
2014-05-05 20:58:33 +02:00
2014-03-31 22:36:17 +02:00
2014-05-05 20:58:33 +02:00
2014-05-05 20:58:33 +02:00
2014-02-14 21:07:13 +01:00
2014-07-06 09:13:53 +03:00
2014-02-14 20:50:19 +01:00
2014-03-31 22:35:03 +02:00
2014-02-14 16:22:33 +01:00
2014-02-14 16:22:33 +01:00
2014-05-28 14:27:42 +02:00
2013-02-01 08:32:20 +01:00
2014-02-14 21:02:27 +01:00
2014-03-31 22:35:50 +02:00
2014-03-13 01:21:56 +01:00
2014-02-14 21:01:03 +01:00
2014-03-13 01:21:56 +01:00
2014-02-14 16:22:33 +01:00