block/backup: add backup_is_cluster_allocated
commitdba8700f16ebda0632977c303f66021407971081
authorJohn Snow <jsnow@redhat.com>
Mon, 29 Jul 2019 20:35:55 +0000 (29 16:35 -0400)
committerJohn Snow <jsnow@redhat.com>
Fri, 16 Aug 2019 20:28:03 +0000 (16 16:28 -0400)
treeed2c03fca3fa636d2f0ee420934ae082d9c9a448
parent141cdcdf84a07c8f23f8b1c4e3c5ebb0669f7616
block/backup: add backup_is_cluster_allocated

Modify bdrv_is_unallocated_range to utilize the pnum return from
bdrv_is_allocated, and in the process change the semantics from
"is unallocated" to "is allocated."

Optionally returns a full number of clusters that share the same
allocation status.

This will be used to carefully toggle bits in the bitmap for sync=top
initialization in the following commits.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 20190716000117.25219-9-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
block/backup.c