On 3/17/20 1:15 PM, Alberto Garcia wrote:
The file_cluster_offset field of Qcow2AioTask stores a cluster-aligned
host offset. In practice this is not very useful because all users(*)
of this structure need the final host offset into the cluster, which
they calculate using

    host_offset = file_cluster_offset + offset_into_cluster(s, offset)

There is no reason why Qcow2AioTask cannot store host_offset directly
and that is what this patch does.

(*) compressed clusters are the exception: in this case what
     file_cluster_offset was storing was the full compressed cluster
     descriptor (offset + size). This does not change with this patch
     but it is documented now.

Signed-off-by: Alberto Garcia <be...@igalia.com>
---
  block/qcow2.c | 68 +++++++++++++++++++++++++--------------------------
  1 file changed, 33 insertions(+), 35 deletions(-)


Reviewed-by: Eric Blake <ebl...@redhat.com>

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


Reply via email to