coding-style: Allow some use of ternary operators
coding-style: Allow some use of ternary operators

While we all understand that excessive use of ternary operator
may worsen code readability (e.g. nested, multi-line expression),
there are few cases where using it actually improves code
readability. For instance, when a function takes a long list of
arguments out of which one depends on a boolean expression, or
when formatting "yes"/"no" or "on"/"off" values based on a
boolean variable (although one can argue that the latter is a
subset of the former). Just consider alternatives to:

  virBufferAsprintf(buf, "<elem>%s</elem>\n", boolVar ? "yes" : "no");

In fact, this pattern occurs plenty in our code. Exempt it from
our "no ternary operators" rule.

Signed-off-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>
Reviewed-by: Claudio Fontana <b69352cd5992c270120dd2b68be30033a38f7beb@suse.de>
Reviewed-by: Daniel P. Berrangé <bb938cf255e055ff3507f2627d214e8e62118fcf@redhat.com>

olafhering/libvirt,jfehlig/libvirt,libvirt/libvirt,jfehlig/libvirt,zippy2/libvirt,crobinso/libvirt,jfehlig/libvirt,zippy2/libvirt,libvirt/libvirt,jfehlig/libvirt,libvirt/libvirt,olafhering/libvirt,zippy2/libvirt,libvirt/libvirt,olafhering/libvirt,crobinso/libvirt,crobinso/libvirt,zippy2/libvirt,crobinso/libvirt,olafhering/libvirt