On a Thursday in 2025, Pavel Hrdina wrote:
Use the new virXMLFormatDirect in order to remove usage of virXMLFormatInternal. Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx> --- src/conf/domain_conf.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 94f456a362..0bcbf32bb4 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -27014,7 +27009,10 @@ virDomainLoaderDefFormatNvram(virBuffer *buf, } } - virXMLFormatElementInternal(buf, "nvram", &attrBuf, childBuf, false, childNewline); + if (virBufferUse(&directBuf) > 0) + virXMLFormatElementDirect(buf, "nvram", &attrBuf, &directBuf); + else + virXMLFormatElement(buf, "nvram", &attrBuf, &childBuf);
Not a fan of these extra lines. '<' is not a valid character in the element's "direct" value. Instead of the "childNewline" boolean, maybe virXMLFormatElement can check the first character for this and decide based on that? Jano
return 0; } -- 2.48.1
Attachment:
signature.asc
Description: PGP signature