On 2018-01-26 15:59, Alberto Garcia wrote: > Each entry in the qcow2 L2 cache stores a full L2 table (which uses a > complete cluster in the qcow2 image). A cluster is usually too large > to be used efficiently as the size for a cache entry, so we want to > decouple both values by allowing smaller cache entries. Therefore the > qcow2 L2 cache will no longer return full L2 tables but slices > instead. > > This patch updates l2_load() so it can handle L2 slices correctly. > Apart from the offset of the L2 table (which we already had) we also > need the guest offset in order to calculate which one of the slices > we need. > > An L2 slice has currently the same size as an L2 table (one cluster), > so for now this function will load exactly the same data as before. > > This patch also removes a stale comment about the return value being > a pointer to the L2 table. This function returns an error code since > 55c17e9821c474d5fcdebdc82ed2fc096777d611. > > Signed-off-by: Alberto Garcia <be...@igalia.com> > Reviewed-by: Eric Blake <ebl...@redhat.com> > --- > block/qcow2-cluster.c | 28 +++++++++++++++++----------- > 1 file changed, 17 insertions(+), 11 deletions(-)
Reviewed-by: Max Reitz <mre...@redhat.com>
signature.asc
Description: OpenPGP digital signature