]> xenbits.xensource.com Git - libvirt.git/commit
conf: simplify Buffer Indentation in virDomainNetDefFormat
authorLaine Stump <laine@laine.org>
Wed, 1 Aug 2012 07:28:28 +0000 (03:28 -0400)
committerLaine Stump <laine@laine.org>
Tue, 14 Aug 2012 19:47:39 +0000 (15:47 -0400)
commitff1efc0901a57a846aa1ebc90c2a11daa5ab9967
tree8f374ee47dc14ef9a34871a602b13aa1cdbe69d5
parent2841a0ad0f028adab29bdb08797d6841e4a333d8
conf: simplify Buffer Indentation in virDomainNetDefFormat

This function has several calls to increase the buffer indent by 6,
then decrease it again, then increase, then decrease. Additionally,
there were several printfs that had 6 spaces at the beginning of the
line.

virDomainActualNetDefFormat, which is called by virDomainNetDefFormat,
had similar ugliness.

This patch changes both functions to just increase the indent at the
beginning, decrease it at (well, just before*) the end, and remove all
of the occurences of 6/8 spaces at the beginning of lines.

*The indent had to be reset before the end of the function because
virDomainDeviceInfoFormat assumes a 0 indent and is called from many
other places, and I didn't want to do an overhaul of every caller of
that function. A separate patch to switch all of domain_conf.c would
be a useful exercise, but my current goal is unrelated to that, so
I'll leave it for another day.
src/conf/domain_conf.c