render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
404507
From d91de09fa0a626e200ac0db133a6af69a0706105 Mon Sep 17 00:00:00 2001
404507
Message-Id: <d91de09fa0a626e200ac0db133a6af69a0706105@dist-git>
404507
From: Andrea Bolognani <abologna@redhat.com>
404507
Date: Wed, 29 Nov 2017 16:23:04 +0100
404507
Subject: [PATCH] conf: Remove ATTRIBUTE_FALLTHROUGH from
404507
 virDomainChrTargetDefFormat()
404507
404507
Formatting the <target/> element for serial devices will become a
404507
bit more complicated later on, and leaving the fallthrough behavior
404507
there would do nothing but complicate it further.
404507
404507
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
404507
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
404507
(cherry picked from commit 7983068fa50ea5222e62b24ea912a529994276f0)
404507
404507
https://bugzilla.redhat.com/show_bug.cgi?id=1449265
404507
https://bugzilla.redhat.com/show_bug.cgi?id=1511421
404507
https://bugzilla.redhat.com/show_bug.cgi?id=1512929
404507
https://bugzilla.redhat.com/show_bug.cgi?id=1512934
404507
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
404507
---
404507
 src/conf/domain_conf.c | 14 +++++++++-----
404507
 1 file changed, 9 insertions(+), 5 deletions(-)
404507
404507
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
404507
index 2489705d6b..44d9bbe01d 100644
404507
--- a/src/conf/domain_conf.c
404507
+++ b/src/conf/domain_conf.c
404507
@@ -24010,14 +24010,18 @@ virDomainChrTargetDefFormat(virBufferPtr buf,
404507
             return -1;
404507
         }
404507
 
404507
+        virBufferAddLit(buf, "
404507
+
404507
         if (def->targetType != VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE) {
404507
             virBufferAsprintf(buf,
404507
-                              "<target type='%s' port='%d'/>\n",
404507
-                              targetType,
404507
-                              def->target.port);
404507
-            break;
404507
+                              "type='%s' ",
404507
+                              targetType);
404507
         }
404507
-        ATTRIBUTE_FALLTHROUGH;
404507
+
404507
+        virBufferAsprintf(buf,
404507
+                          "port='%d'/>\n",
404507
+                          def->target.port);
404507
+        break;
404507
 
404507
     case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL:
404507
         virBufferAsprintf(buf, "<target port='%d'/>\n",
404507
-- 
404507
2.15.1
404507