Re: [PATCH 2/2] conf: switch virDomainSchedulerFormat to use virXMLFormatElement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux