]> git.proxmox.com Git - mirror_qemu.git/commit - block/qcow2-cluster.c
qcow2: Convert qcow2_alloc_cluster_offset() into qcow2_alloc_host_offset()
authorAlberto Garcia <berto@igalia.com>
Fri, 11 Sep 2020 14:09:42 +0000 (16:09 +0200)
committerMax Reitz <mreitz@redhat.com>
Tue, 15 Sep 2020 09:31:10 +0000 (11:31 +0200)
commitbfd0989acffe0b348a4be5155a4688d92c34b1ef
treedf637043ee73abbde01b7aab23ebff1a28bf5209
parent8e958260c5a562f3be08beef2055975c04836200
qcow2: Convert qcow2_alloc_cluster_offset() into qcow2_alloc_host_offset()

qcow2_alloc_cluster_offset() takes an (unaligned) guest offset and
returns the (aligned) offset of the corresponding cluster in the qcow2
image.

In practice none of the callers need to know where the cluster starts
so this patch makes the function calculate and return the final host
offset directly. The function is also renamed accordingly.

See 388e581615 for a similar change to qcow2_get_cluster_offset().

Signed-off-by: Alberto Garcia <berto@igalia.com>
Message-Id: <9bfef50ec9200d752413be4fc2aeb22a28378817.1599833007.git.berto@igalia.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/qcow2-cluster.c
block/qcow2.c
block/qcow2.h