On Thu, Jan 05, 2023 at 09:34:55 +0100, Michal Privoznik wrote: > We are formatting <enum/> element and its children using > virBufferAddLit(), virBufferAsprintf(), virBufferAdjustIndent(), > etc. Well, we can avoid that when switching to > virXMLFormatElement(). > > Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx> > --- > src/conf/domain_capabilities.c | 15 +++++---------- > 1 file changed, 5 insertions(+), 10 deletions(-) > > diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c > index 4e412c0fd8..b464298003 100644 > --- a/src/conf/domain_capabilities.c > +++ b/src/conf/domain_capabilities.c > @@ -269,18 +269,14 @@ virDomainCapsEnumFormat(virBuffer *buf, > const char *capsEnumName, > virDomainCapsValToStr valToStr) > { > + virBuffer attrBuf = VIR_BUFFER_INITIALIZER; > + virBuffer childBuf = VIR_BUFFER_INIT_CHILD(buf); Preferrably declare these as 'g_auto(virBuffer) ...'. Reviewed-by: Peter Krempa <pkrempa@xxxxxxxxxx>