[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 13/32] qcow2: Add l2_slice_size field to BDRV
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2 13/32] qcow2: Add l2_slice_size field to BDRVQcow2State |
Date: |
Tue, 16 Jan 2018 16:06:21 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
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 <address@hidden>
> ---
> 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 <address@hidden>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v2 13/32] qcow2: Add l2_slice_size field to BDRVQcow2State,
Eric Blake <=