}
+static void
+virDomainIOMMUDefFormat(virBufferPtr buf,
+ const virDomainIOMMUDef *iommu)
+{
+ virBufferAsprintf(buf, "<iommu model='%s'/>\n",
+ virDomainIOMMUModelTypeToString(iommu->model));
+}
+
+
/* This internal version appends to an existing buffer
* (possibly with auto-indent), rather than flattening
* to string.
goto error;
}
- if (def->iommu) {
- virBufferAsprintf(buf, "<iommu model='%s'/>\n",
- virDomainIOMMUModelTypeToString(def->iommu->model));
- }
+ if (def->iommu)
+ virDomainIOMMUDefFormat(buf, def->iommu);
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</devices>\n");