block/backup: refactor and tolerate unallocated cluster skipping
commit9eb5a248f3e50c1f034bc6ff4b2f25c8c56515a5
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Mon, 29 Apr 2019 09:08:40 +0000 (29 12:08 +0300)
committerMax Reitz <mreitz@redhat.com>
Tue, 28 May 2019 18:30:55 +0000 (28 20:30 +0200)
tree381b2781f2903bda5ba6df9ee76b941dc3adaa75
parenta8389e315ef71913ae99cf8f3b1f89e84631f599
block/backup: refactor and tolerate unallocated cluster skipping

Split allocation checking to separate function and reduce nesting.
Consider bdrv_is_allocated() fail as allocated area, as copying more
than needed is not wrong (and we do it anyway) and seems better than
fail the whole job. And, most probably we will fail on the next read,
if there are real problem with source.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 20190429090842.57910-4-vsementsov@virtuozzo.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/backup.c