[PATCH 2/2] conf: switch virDomainSchedulerFormat to use virXMLFormatElement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 93d32c9df1..1f44237b11 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -27196,30 +27196,30 @@ virDomainSchedulerFormat(virBufferPtr buf,
                          virDomainThreadSchedParamPtr sched,
                          size_t id)
 {
+    VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
+
     switch (sched->policy) {
         case VIR_PROC_POLICY_BATCH:
         case VIR_PROC_POLICY_IDLE:
-            virBufferAsprintf(buf, "<%s "
-                              "%s='%zu' scheduler='%s'/>\n",
-                              elementName, idAttributeName, id,
+            virBufferAsprintf(&attrBuf, " %s='%zu'", idAttributeName, id);
+            virBufferAsprintf(&attrBuf, " scheduler='%s'",
                               virProcessSchedPolicyTypeToString(sched->policy));
             break;
 
         case VIR_PROC_POLICY_RR:
         case VIR_PROC_POLICY_FIFO:
-            virBufferAsprintf(buf, "<%s "
-                              "%s='%zu' scheduler='%s' priority='%d'/>\n",
-                              elementName, idAttributeName, id,
-                              virProcessSchedPolicyTypeToString(sched->policy),
-                              sched->priority);
+            virBufferAsprintf(&attrBuf, " %s='%zu'", idAttributeName, id);
+            virBufferAsprintf(&attrBuf, " scheduler='%s'",
+                              virProcessSchedPolicyTypeToString(sched->policy));
+            virBufferAsprintf(&attrBuf, " priority='%d'", sched->priority);
             break;
 
         case VIR_PROC_POLICY_NONE:
         case VIR_PROC_POLICY_LAST:
-            break;
+            return 0;
         }
 
-    return 0;
+    return virXMLFormatElement(buf, elementName, &attrBuf, NULL);
 }
 
 
-- 
2.19.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux