On Mon, 2019-04-15 at 16:55 +0200, Ján Tomko wrote:
[...]
> switch (sched->policy) {
> case VIR_PROC_POLICY_BATCH:
> case VIR_PROC_POLICY_IDLE:
> - virBufferAsprintf(buf, "<%s "
> - "%s='%zu' scheduler='%s'/>\n",
> - elementName, idAttributeName, id,
> + virBufferAsprintf(&attrBuf, " %s='%zu'", idAttributeName, id);
> + virBufferAsprintf(&attrBuf, " scheduler='%s'",
>
> virProcessSchedPolicyTypeToString(sched->policy));
Since these two attributes (idAttributeName and 'scheduler') are
formatted the same way for the two cases below, how about replacing
the 'break' with 'ATTRIBUTE_FALLTHROUGH' to avoid repetition?
I'm also not sure why you turned a single call to virBufferAsprintf()
into two or three separate calls to it.
Looks good otherwise.
--
Andrea Bolognani / Red Hat / Virtualization
--
libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list