Re: [Xen-devel] [PATCH 01/12] libxc/save: Shrink code volume where possible

2020-01-15 Thread Andrew Cooper
On 14/01/2020 16:48, Ian Jackson wrote: > Andrew Cooper writes ("[PATCH 01/12] libxc/save: Shrink code volume where > possible"): >> A property of how the error handling (0 on success, nonzero otherwise) >> allows these calls to be chained together with the ternary operatior. > I'm quite

Re: [Xen-devel] [PATCH 01/12] libxc/save: Shrink code volume where possible

2020-01-14 Thread Ian Jackson
Ian Jackson writes ("Re: [PATCH 01/12] libxc/save: Shrink code volume where possible"): > Maybe it would be better to have > #define MUST(call) ({ rc = (call); if (rc) goto error; }) > and write > MUST( write_one_vcpu_basic(ctx, i) ); This is not uncommon. BIND9 does something like it:

Re: [Xen-devel] [PATCH 01/12] libxc/save: Shrink code volume where possible

2020-01-14 Thread Ian Jackson
Andrew Cooper writes ("[PATCH 01/12] libxc/save: Shrink code volume where possible"): > A property of how the error handling (0 on success, nonzero otherwise) > allows these calls to be chained together with the ternary operatior. I'm quite surprised to find a suggestion like this coming from

[Xen-devel] [PATCH 01/12] libxc/save: Shrink code volume where possible

2019-12-24 Thread Andrew Cooper
A property of how the error handling (0 on success, nonzero otherwise) allows these calls to be chained together with the ternary operatior. No functional change, but far less boilerplate code. Signed-off-by: Andrew Cooper --- CC: Ian Jackson CC: Wei Liu --- tools/libxc/xc_sr_save.c