]> git.proxmox.com Git - mirror_qemu.git/commit
qcow: Switch get_cluster_offset to be byte-based
authorEric Blake <eblake@redhat.com>
Thu, 28 Jun 2018 20:15:19 +0000 (15:15 -0500)
committerKevin Wolf <kwolf@redhat.com>
Fri, 29 Jun 2018 12:20:56 +0000 (14:20 +0200)
commit787993a5435289e90479f80f81681c804a9d22ce
treee2d8f7f6de6a1afa0d793775eade86b56c5a3ee8
parentd08c2a245feb6ab82b5a044f72c75964eedeaef5
qcow: Switch get_cluster_offset to be byte-based

We are gradually moving away from sector-based interfaces, towards
byte-based.  Make the change for the internal helper function
get_cluster_offset(), by changing n_start and n_end to be byte
offsets rather than sector indices within the cluster being
allocated.  However, assert that these values are still
sector-aligned (at least qcrypto_block_encrypt() still wants that).
For now we get that alignment for free because we still use
sector-based driver callbacks.

A later patch will then switch the qcow driver as a whole over
to byte-based operation; but will still leave things at sector
alignments as it is not worth auditing the qcow image format
to worry about sub-sector requests.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow.c