[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 04/14] block/amend: separate amend and create options for
From: |
Max Reitz |
Subject: |
Re: [PATCH v6 04/14] block/amend: separate amend and create options for qemu-img |
Date: |
Fri, 15 May 2020 08:22:04 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
On 14.05.20 18:10, Eric Blake wrote:
> On 5/14/20 7:28 AM, Max Reitz wrote:
>> On 10.05.20 15:40, Maxim Levitsky wrote:
>>> Some options are only useful for creation
>>> (or hard to be amended, like cluster size for qcow2), while some other
>>> options are only useful for amend, like upcoming keyslot management
>>> options for luks
>>>
>
>>> +#define QCOW_COMMON_OPTIONS \
>>> + { \
>
>>> + .help = "Width of a reference count entry in bits", \
>>> + .def_value_str = "16" \
>>> + } \
>>
>> I think the last line should have a comma in it (otherwise the final
>> backslash doesn’t make much sense, because whenever we’d add a new
>> option, we would need to modify the line anyway to insert a comma).
>
> Except that...
>
>>
>> Speaking of adding option, this requires a rebase due to the
>> compression_type option added (not trivial in the strict sense, but
>> still straightforward to handle).
>>
>>> +
>>> static QemuOptsList qcow2_create_opts = {
>>> .name = "qcow2-create-opts",
>>> .head = QTAILQ_HEAD_INITIALIZER(qcow2_create_opts.head),
>>> .desc = {
>>>
>>
>> [...]
>>
>>> + QCOW_COMMON_OPTIONS,
>>> + { /* end of list */ }
>
> ...the intended usage is to use the macro name followed by a comma, so
> including a trailing comma in the macro itself would lead to a syntax
> error.
But why is that the indended usage? Is there something in our coding
style that forbids macros that don’t allow a separator to be placed
after them?
Max
signature.asc
Description: OpenPGP digital signature
[PATCH v6 05/14] block/amend: refactor qcow2 amend options, Maxim Levitsky, 2020/05/10
[PATCH v6 08/14] block/qcow2: extend qemu-img amend interface with crypto options, Maxim Levitsky, 2020/05/10
[PATCH v6 09/14] iotests: filter few more luks specific create options, Maxim Levitsky, 2020/05/10