On 12/15/2017 06:53 AM, Alberto Garcia wrote: > The BDRVQcow2State structure contains an l2_size field, which stores > the number of 64-bit entries in an L2 table. > > For efficiency reasons we want to be able to load slices instead of > full L2 tables, so we need to know how many entries an L2 slice can > hold. > > An L2 slice is the portion of an L2 table that is loaded by the qcow2 > cache. At the moment that cache can only load complete tables, > therefore an L2 slice has the same size as an L2 table (one cluster) > and l2_size == l2_slice_size. > > Later we'll allow smaller slices, but until then we have to use this > new l2_slice_size field to make the rest of the code ready for that. > > Signed-off-by: Alberto Garcia <be...@igalia.com> > --- > block/qcow2.c | 3 +++ > block/qcow2.h | 1 + > 2 files changed, 4 insertions(+) > > diff --git a/block/qcow2.c b/block/qcow2.c > index bdac1c156f..c1e4bab391 100644 > --- a/block/qcow2.c > +++ b/block/qcow2.c > @@ -797,6 +797,7 @@ static void read_cache_sizes(BlockDriverState *bs, > QemuOpts *opts, > typedef struct Qcow2ReopenState { > Qcow2Cache *l2_table_cache; > Qcow2Cache *refcount_block_cache; > + int l2_slice_size;
Worth a comment? /* Number of entries in a slice of the L2 table */ With or without, Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature