qemu-block
[Top][All Lists]
Advanced

[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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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