Hi Eric,
On 2/19/19 9:12 PM, Eric Blake wrote:
> On 2/19/19 1:15 PM, Aleksandar Markovic wrote:
>> From: Pavel Dovgalyuk <[email protected]>
>>
>> This patch enables QMP-based querying of the available CPU types for
>> MIPS and MIPS64 platforms.
>>
>> Signed-off-by: Pavel Dovgalyuk <[email protected]>
>> Signed-off-by: Aleksandar Markovic <[email protected]>
>> Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
>> Tested-by: Philippe Mathieu-Daudé <[email protected]>
>> ---
>
>> +++ b/qapi/target.json
>> @@ -499,7 +499,7 @@
>> 'static': 'bool',
>> '*unavailable-features': [ 'str' ],
>> 'typename': 'str' },
>> - 'if': 'defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_I386)
>> || defined(TARGET_S390X)' }
>> + 'if': 'defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_I386)
>> || defined(TARGET_S390X) || defined(TARGET_MIPS)' }
>
> Hmm. Long line; however, the argument to 'if' is pasted literally to an
> #if directive, which would break if we added newlines in the middle.
> And we can't use literal newlines in the middle of a JSON string. About
> the only thing I could think of that might allow for more manageable
> line lengths would be permitting:
>
> 'if': [ 'defined(TARGET_PPC)',
> 'defined(TARGET_ARM)' ...]
Can this be:
'if': [
'defined(TARGET_PPC)',
'defined(TARGET_ARM)',
...
]
?
> where the QAPI generator would in turn form the disjunction of supplying
> the || between each term when the 'if' is an array of strings. But that
> feels like a lot of effort for little gain compared to just living with
> the long lines.
Single line looks easier thus less bug prone.
Multiline improves git diff/blame.
The former looks safer.