render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
3e5111
From 0823b17d4ddc02a0bfca9fece7ff5ae3fd106a91 Mon Sep 17 00:00:00 2001
3e5111
Message-Id: <0823b17d4ddc02a0bfca9fece7ff5ae3fd106a91@dist-git>
3e5111
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
3e5111
Date: Tue, 16 May 2017 10:44:49 +0200
3e5111
Subject: [PATCH] Split out virDomainIOMMUDefFormat
3e5111
MIME-Version: 1.0
3e5111
Content-Type: text/plain; charset=UTF-8
3e5111
Content-Transfer-Encoding: 8bit
3e5111
3e5111
Make adding subelements easier.
3e5111
3e5111
(cherry picked from commit d34ac94351255721ae86eba561cd2ba1d620ab7b)
3e5111
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3e5111
3e5111
https://bugzilla.redhat.com/show_bug.cgi?id=1427005
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
---
3e5111
 src/conf/domain_conf.c | 15 +++++++++++----
3e5111
 1 file changed, 11 insertions(+), 4 deletions(-)
3e5111
3e5111
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
3e5111
index a918ecd59..4096b9caf 100644
3e5111
--- a/src/conf/domain_conf.c
3e5111
+++ b/src/conf/domain_conf.c
3e5111
@@ -24068,6 +24068,15 @@ virDomainDefIothreadShouldFormat(virDomainDefPtr def)
3e5111
 }
3e5111
 
3e5111
 
3e5111
+static void
3e5111
+virDomainIOMMUDefFormat(virBufferPtr buf,
3e5111
+                        const virDomainIOMMUDef *iommu)
3e5111
+{
3e5111
+    virBufferAsprintf(buf, "<iommu model='%s'/>\n",
3e5111
+                      virDomainIOMMUModelTypeToString(iommu->model));
3e5111
+}
3e5111
+
3e5111
+
3e5111
 /* This internal version appends to an existing buffer
3e5111
  * (possibly with auto-indent), rather than flattening
3e5111
  * to string.
3e5111
@@ -24814,10 +24823,8 @@ virDomainDefFormatInternal(virDomainDefPtr def,
3e5111
             goto error;
3e5111
     }
3e5111
 
3e5111
-    if (def->iommu) {
3e5111
-        virBufferAsprintf(buf, "<iommu model='%s'/>\n",
3e5111
-                          virDomainIOMMUModelTypeToString(def->iommu->model));
3e5111
-    }
3e5111
+    if (def->iommu)
3e5111
+        virDomainIOMMUDefFormat(buf, def->iommu);
3e5111
 
3e5111
     virBufferAdjustIndent(buf, -2);
3e5111
     virBufferAddLit(buf, "</devices>\n");
3e5111
-- 
3e5111
2.13.0
3e5111