[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH v2 16/32] qcow2: Update l2_allocate

From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v2 16/32] qcow2: Update l2_allocate() to support L2 slices
Date: Wed, 17 Jan 2018 10:06:04 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

On 01/17/2018 09:55 AM, Alberto Garcia wrote:
> On Tue 16 Jan 2018 11:26:40 PM CET, Eric Blake wrote:
>>>      /* allocate a new entry in the l2 cache */
>>> +    slice_size = s->l2_slice_size * sizeof(uint64_t);
>> Would this read any better if the earlier patch named it
>> s->l2_slice_entries?
> I had doubts with this. Like you, when I see size I tend to think about
> bytes. However both s->l1_size and s->l2_size indicate entries, and the
> documentation of the qcow2 format even describes the header field like
> this:
>          36 - 39:   l1_size
>                     Number of entries in the active L1 table

We're free to rename the field in the qcow2 format specification if it
makes things easier to understand.  If l1_entries reads better than
l1_size, maybe it's worth doing.

> So I decided to follow that same convention for l2_slice_size.
> For the local variable I could call it slice_size_bytes or try to come
> up with a different alternative, but I'm open to suggestions.
> Berto

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

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]