qcow2: Assert that cluster operations are aligned
commitf10ee139adee1c18d399dc57a7ee22a03fa59513
authorEric Blake <eblake@redhat.com>
Sun, 7 May 2017 00:05:51 +0000 (6 19:05 -0500)
committerMax Reitz <mreitz@redhat.com>
Thu, 11 May 2017 12:28:07 +0000 (11 14:28 +0200)
tree040ae8f4828cb2e0d5a384ea48ea75b21743fa6b
parentfbaa6bb3d3b4be71b7e234e908cb3c6bd280a222
qcow2: Assert that cluster operations are aligned

We already audited (in commit 0c1bd469) that qcow2_discard_clusters()
is only passed cluster-aligned start values; but we can further
tighten the assertion that the only unaligned end value is at EOF.

Recent commits have taken advantage of an unaligned tail cluster,
for both discard and write zeroes.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 20170507000552.20847-12-eblake@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/qcow2-cluster.c