virDomainNetDefFormat: Modernize <tune/> formatting

The <tune/> child element of <interface/> is formatted the old
way. Switch to virXMLFormatElement().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Michal Privoznik 2023-01-31 10:46:59 +01:00
parent 58e0bd73e0
commit 86d10e6259
2 changed files with 8 additions and 5 deletions

View File

@ -23993,11 +23993,11 @@ virDomainNetDefFormat(virBuffer *buf,
}
if (def->tune.sndbuf_specified) {
virBufferAddLit(buf, "<tune>\n");
virBufferAdjustIndent(buf, 2);
virBufferAsprintf(buf, "<sndbuf>%llu</sndbuf>\n", def->tune.sndbuf);
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</tune>\n");
g_auto(virBuffer) sndChildBuf = VIR_BUFFER_INIT_CHILD(buf);
virBufferAsprintf(&sndChildBuf, "<sndbuf>%llu</sndbuf>\n", def->tune.sndbuf);
virXMLFormatElement(buf, "tune", NULL, &sndChildBuf);
}
virDomainNetTeamingInfoFormat(def->teaming, buf);

View File

@ -50,6 +50,9 @@
<mac address='52:54:00:e5:48:59'/>
<source network='default'/>
<model type='virtio'/>
<tune>
<sndbuf>1600</sndbuf>
</tune>
<mtu size='9000'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>