]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Split out virDomainIOMMUDefFormat
authorJán Tomko <jtomko@redhat.com>
Mon, 20 Mar 2017 09:25:34 +0000 (10:25 +0100)
committerJán Tomko <jtomko@redhat.com>
Thu, 13 Apr 2017 12:25:41 +0000 (14:25 +0200)
Make adding subelements easier.

src/conf/domain_conf.c

index 0dbd45f45fbc0be35a41155acb6a38300125f489..9bec68beb22b9fb1691e8539d96e2cb396796456 100644 (file)
@@ -23989,6 +23989,15 @@ virDomainDefIothreadShouldFormat(virDomainDefPtr def)
 }
 
 
+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.
@@ -24735,10 +24744,8 @@ virDomainDefFormatInternal(virDomainDefPtr def,
             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");