qemu-block
[Top][All Lists]
Advanced

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

Re: [PATCH v4 11/30] qcow2: Add l2_entry_size()


From: Alberto Garcia
Subject: Re: [PATCH v4 11/30] qcow2: Add l2_entry_size()
Date: Tue, 14 Apr 2020 14:33:54 +0200
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu)

On Tue 14 Apr 2020 02:29:13 PM CEST, Vladimir Sementsov-Ogievskiy wrote:
>>> Hmm. How to avoid it? Maybe, at least, refactor the code, to drop all
>>> sizeof(uint64_t), converting them to L2_ENTRY_SIZE, L1_ENTRY_SIZE,
>>> REFTABLE_ENTRY_SIZE etc?
>> 
>> That wouldn't be a bad thing I guess but, again, for a separate patch or
>> series.
>> 
>>> And all occurrences of pure '8' (not many of them exist)
>> 
>> I think most/all nowadays only refer to the number of bits per byte.
>> 
>> Maybe there's a couple that still need to be fixed, but we have been
>> removing a lot of numeric literals from the qcow2 code (see for example
>> b6c246942b, 3afea40243 or a35f87f50d).
>> 
>
>
> git grep '\<8\>' block/qcow2*
>
> shows at least
>
> qcow2-cluster.c:            s->l1_table_offset + 8 * l1_start_index, bufsize, 
> false);
> qcow2-cluster.c:                           s->l1_table_offset + 8 * 
> l1_start_index,

I see, worth replacing with L1_ENTRY_SIZE as you suggest. I can take of
writing the patches if you want.

Berto



reply via email to

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