Skip to content

Convert qcow2_get_cluster_offset() into qcow2_get_host_offset()

Alberto Garcia qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2qcow2: Make Qcow2AioTask store the full host offsetblock/qcow2.c+33 -350 replies
2/2qcow2: Convert qcow2_get_cluster_offset() into qcow2_get_host_offset()block/qcow2-cluster.c block/qcow2.c block/qcow2.h+31 -350 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] Convert qcow2_get_cluster_offset() into qcow2_get_host_offset()

Hi,

this is something I did while working on the subcluster series but it's independent from it so I thought to send it already.

In short: qcow2_get_cluster_offset() returns a host cluster offset but none of the callers actually wants the offset of the cluster, they want the host offset into the cluster.

There's a pre-existing exception with compressed clusters. In this case the returned value was overloaded to contain a cluster offset or a compressed cluster descriptor, depending on the cluster type. This is kind of ugly, and we could make it more explicit using a union or something like that but I don't think it's worth the effort here, so I just documented it.

Berto

Alberto Garcia (2):
qcow2: Make Qcow2AioTask store the full host offset
qcow2: Convert qcow2_get_cluster_offset() into qcow2_get_host_offset()

 block/qcow2.h         |  4 +--
 block/qcow2-cluster.c | 38 ++++++++++++----------
 block/qcow2.c         | 74 ++++++++++++++++++-------------------------
 3 files changed, 55 insertions(+), 61 deletions(-)
Signature · 1 line
2.20.1