These buffers are used temporarily for some of the partial formatters
but not globally. Prefix the name with 'tmp' to be explicit.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/conf/domain_conf.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 70f3ac4fde..9ed153a71f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -27745,8 +27745,8 @@ static int
virDomainDefFormatFeatures(virBufferPtr buf,
virDomainDefPtr def)
{
- virBuffer attributeBuf = VIR_BUFFER_INITIALIZER;
- virBuffer childrenBuf = VIR_BUFFER_INITIALIZER;
+ virBuffer tmpAttrBuf = VIR_BUFFER_INITIALIZER;
+ virBuffer tmpChildBuf = VIR_BUFFER_INITIALIZER;
size_t i;
for (i = 0; i < VIR_DOMAIN_FEATURE_LAST; i++) {
@@ -27979,23 +27979,23 @@ virDomainDefFormatFeatures(virBufferPtr buf,
if (def->features[i] != VIR_TRISTATE_SWITCH_ON)
break;
- virBufferFreeAndReset(&attributeBuf);
- virBufferFreeAndReset(&childrenBuf);
+ virBufferFreeAndReset(&tmpAttrBuf);
+ virBufferFreeAndReset(&tmpChildBuf);
if (def->hpt_resizing != VIR_DOMAIN_HPT_RESIZING_NONE) {
- virBufferAsprintf(&attributeBuf,
+ virBufferAsprintf(&tmpAttrBuf,
" resizing='%s'",
virDomainHPTResizingTypeToString(def->hpt_resizing));
}
if (def->hpt_maxpagesize > 0) {
- virBufferSetChildIndent(&childrenBuf, buf);
- virBufferAsprintf(&childrenBuf,
+ virBufferSetChildIndent(&tmpChildBuf, buf);
+ virBufferAsprintf(&tmpChildBuf,
"<maxpagesize
unit='KiB'>%llu</maxpagesize>\n",
def->hpt_maxpagesize);
}
if (virXMLFormatElement(buf, "hpt",
- &attributeBuf, &childrenBuf) < 0) {
+ &tmpAttrBuf, &tmpChildBuf) < 0) {
goto error;
}
break;
@@ -28020,8 +28020,8 @@ virDomainDefFormatFeatures(virBufferPtr buf,
return 0;
error:
- virBufferFreeAndReset(&attributeBuf);
- virBufferFreeAndReset(&childrenBuf);
+ virBufferFreeAndReset(&tmpAttrBuf);
+ virBufferFreeAndReset(&tmpChildBuf);
return -1;
}
--
2.20.1