[Top][All Lists]

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

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/1] include: Auto-generate the

From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/1] include: Auto-generate the sizes lookup table
Date: Fri, 11 Jan 2019 09:29:47 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1

On 1/11/19 1:50 AM, Markus Armbruster wrote:

>>> We have 54 of them.  I count six uses:
>>>      block/qcow2.h:#define QCOW_MAX_REFTABLE_SIZE S_8MiB
>>>      block/qcow2.h:#define QCOW_MAX_L1_SIZE S_32MiB
>>>      block/qcow2.h:#define DEFAULT_L2_CACHE_MAX_SIZE S_32MiB
>>>      block/qcow2.h:#define DEFAULT_L2_CACHE_MAX_SIZE S_8MiB
>>>      block/qcow2.h:#define DEFAULT_CLUSTER_SIZE S_64KiB
>>>      block/vdi.c:#define DEFAULT_CLUSTER_SIZE S_1MiB
>>> Which if them truly need stringify-able integers?
>> These two:
>> block/qcow2.h:#define DEFAULT_CLUSTER_SIZE
>> block/vdi.c:#define DEFAULT_CLUSTER_SIZE.
> Compared to the complexity visible in this thread,
>     .def_value_str = "65536", /* must match DEFAULT_CLUSTER_SIZE */
> looks attractively stupid to me then.

In general, .def_value_str = stringify(...) looks odd, compared to my v3
patch that lets us do .def_value_int = DEFAULT_CLUSTER_SIZE; my patch
also has the benefit that if DEFAULT_CLUSTER_SIZE changes value, we
don't have to remember to update the string.

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

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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