diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 590d90e0a0..ae2e96e964 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -25073,6 +25073,7 @@ virDomainIOMMUDefFormat(virBufferPtr buf, const virDomainIOMMUDef *iommu) { virBuffer childBuf = VIR_BUFFER_INITIALIZER; + virBuffer attrBuf = VIR_BUFFER_INITIALIZER; virBuffer driverAttrBuf = VIR_BUFFER_INITIALIZER; int ret = -1; @@ -25098,16 +25099,11 @@ virDomainIOMMUDefFormat(virBufferPtr buf, if (virXMLFormatElement(&childBuf, "driver", &driverAttrBuf, NULL) < 0) goto cleanup; - virBufferAsprintf(buf, "model)); - if (virBufferError(&childBuf) != 0 || virBufferUse(&childBuf)) { - virBufferAddLit(buf, ">\n"); - virBufferAddBuffer(buf, &childBuf); - virBufferAddLit(buf, "\n"); - } else { - virBufferAddLit(buf, "/>\n"); - } + if (virXMLFormatElement(buf, "iommu", &attrBuf, &childBuf) < 0) + goto cleanup; ret = 0;