[PATCH 5/6] qemu: elmininate hardcoded indent in capabilities cache XML

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

 



---
 src/qemu/qemu_capabilities.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index c589a57..47f8bcb 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2539,38 +2539,39 @@ virQEMUCapsSaveCache(virQEMUCapsPtr qemuCaps, const char *filename)
     size_t i;
 
     virBufferAddLit(&buf, "<qemuCaps>\n");
+    virBufferAdjustIndent(&buf, 2);
 
-    virBufferAsprintf(&buf, "  <qemuctime>%llu</qemuctime>\n",
+    virBufferAsprintf(&buf, "<qemuctime>%llu</qemuctime>\n",
                       (long long)qemuCaps->ctime);
-    virBufferAsprintf(&buf, "  <selfctime>%llu</selfctime>\n",
+    virBufferAsprintf(&buf, "<selfctime>%llu</selfctime>\n",
                       (long long)virGetSelfLastChanged());
 
     if (qemuCaps->usedQMP)
-        virBufferAddLit(&buf, "  <usedQMP/>\n");
+        virBufferAddLit(&buf, "<usedQMP/>\n");
 
     for (i = 0; i < QEMU_CAPS_LAST; i++) {
         if (virQEMUCapsGet(qemuCaps, i)) {
-            virBufferAsprintf(&buf, "  <flag name='%s'/>\n",
+            virBufferAsprintf(&buf, "<flag name='%s'/>\n",
                               virQEMUCapsTypeToString(i));
         }
     }
 
-    virBufferAsprintf(&buf, "  <version>%d</version>\n",
+    virBufferAsprintf(&buf, "<version>%d</version>\n",
                       qemuCaps->version);
 
-    virBufferAsprintf(&buf, "  <kvmVersion>%d</kvmVersion>\n",
+    virBufferAsprintf(&buf, "<kvmVersion>%d</kvmVersion>\n",
                       qemuCaps->kvmVersion);
 
-    virBufferAsprintf(&buf, "  <arch>%s</arch>\n",
+    virBufferAsprintf(&buf, "<arch>%s</arch>\n",
                       virArchToString(qemuCaps->arch));
 
     for (i = 0; i < qemuCaps->ncpuDefinitions; i++) {
-        virBufferEscapeString(&buf, "  <cpu name='%s'/>\n",
+        virBufferEscapeString(&buf, "<cpu name='%s'/>\n",
                               qemuCaps->cpuDefinitions[i]);
     }
 
     for (i = 0; i < qemuCaps->nmachineTypes; i++) {
-        virBufferEscapeString(&buf, "  <machine name='%s'",
+        virBufferEscapeString(&buf, "<machine name='%s'",
                               qemuCaps->machineTypes[i]);
         if (qemuCaps->machineAliases[i])
             virBufferEscapeString(&buf, " alias='%s'",
@@ -2579,6 +2580,7 @@ virQEMUCapsSaveCache(virQEMUCapsPtr qemuCaps, const char *filename)
                           qemuCaps->machineMaxCpus[i]);
     }
 
+    virBufferAdjustIndent(&buf, -2);
     virBufferAddLit(&buf, "</qemuCaps>\n");
 
     if (virBufferError(&buf))
-- 
1.8.5.3

--
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]