On Wed, Dec 16, 2015 at 08:44:50 -0500, John Ferlan wrote:
On 12/16/2015 08:35 AM, Peter Krempa wrote:
> On Wed, Dec 16, 2015 at 14:18:22 +0100, Michal Privoznik wrote:
>> On 25.11.2015 20:11, John Ferlan wrote:
>>> Although not currently used in more than one command, it soon will be
>>> so create a common macro to be used in the new command location.
>>>
>>> Additionally, add the ".flags = 0," for both to match the
expections
>>> of the structure being predefined.
The compiler already does zero init for fields that are not specified
explicitly.
>>>
>>> Signed-off-by: John Ferlan <jferlan(a)redhat.com>
>>> ---
>>> tools/virsh-pool.c | 24 ++++++++++++++++--------
>>> 1 file changed, 16 insertions(+), 8 deletions(-)
>>>
>>
>> ACK
>
> I don't really fancy this one. It introduces the macro for a very
> uncommon option value. If it will be used more that 10 times it would
> make sense. For 2 or 3 uses it does not.
>
> Peter
>
So then in your opinion and using the same logic, patch 3 is also nixed?
This one will get used in patch 6.
With that use it will result in total 4 uses. I won't object if you fix
the macro name and remove the comma
Patch 3 attempts to create a universal macro for any "file" option, but
that can't be really done universally. See for yourself:
git grep -A 4 '\.name = "file"'
The name of the macro would really need to be specific for pool XML file
name. Any other attempt will create confusion and I don't think it's
worth.
Like I noted in the cover letter - I see value in having the macros and
I also see the pain (having to go look them up).
Adjusting the changes to remove/use commas is fine - just made the
initial cut-n-paste easier
John