[PATCH v2 1/8] domain_capabilities: use early return in virDomainCapsFeatureSEVFormat()

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

 



Signed-off-by: Kristina Hanicova <khanicov at redhat.com>
---
 src/conf/domain_capabilities.c | 33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index 33570a51db..bb36a956db 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -590,25 +590,24 @@ virDomainCapsFeatureSEVFormat(virBuffer *buf,
 {
     if (!sev) {
         virBufferAddLit(buf, "<sev supported='no'/>\n");
-    } else {
-        virBufferAddLit(buf, "<sev supported='yes'>\n");
-        virBufferAdjustIndent(buf, 2);
-        virBufferAsprintf(buf, "<cbitpos>%d</cbitpos>\n", sev->cbitpos);
-        virBufferAsprintf(buf, "<reducedPhysBits>%d</reducedPhysBits>\n",
-                          sev->reduced_phys_bits);
-        virBufferAsprintf(buf, "<maxGuests>%d</maxGuests>\n",
-                          sev->max_guests);
-        virBufferAsprintf(buf, "<maxESGuests>%d</maxESGuests>\n",
-                          sev->max_es_guests);
-        if (sev->cpu0_id != NULL) {
-            virBufferAsprintf(buf, "<cpu0Id>%s</cpu0Id>\n",
-                              sev->cpu0_id);
-        }
-        virBufferAdjustIndent(buf, -2);
-        virBufferAddLit(buf, "</sev>\n");
+        return;
     }
 
-    return;
+    virBufferAddLit(buf, "<sev supported='yes'>\n");
+    virBufferAdjustIndent(buf, 2);
+    virBufferAsprintf(buf, "<cbitpos>%d</cbitpos>\n", sev->cbitpos);
+    virBufferAsprintf(buf, "<reducedPhysBits>%d</reducedPhysBits>\n",
+                      sev->reduced_phys_bits);
+    virBufferAsprintf(buf, "<maxGuests>%d</maxGuests>\n",
+                      sev->max_guests);
+    virBufferAsprintf(buf, "<maxESGuests>%d</maxESGuests>\n",
+                      sev->max_es_guests);
+    if (sev->cpu0_id != NULL) {
+        virBufferAsprintf(buf, "<cpu0Id>%s</cpu0Id>\n",
+                          sev->cpu0_id);
+    }
+    virBufferAdjustIndent(buf, -2);
+    virBufferAddLit(buf, "</sev>\n");
 }
 
 
-- 
2.35.3




[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