mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-04-01 20:05:19 +00:00
conf: Rename temp buffers in virDomainDefFormatFeatures
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@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
4c85929a73
commit
21dd762de8
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user