render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
3e5111
From 5238dd8211d06fc8c7003bb608e41bb2a4653dec Mon Sep 17 00:00:00 2001
3e5111
Message-Id: <5238dd8211d06fc8c7003bb608e41bb2a4653dec@dist-git>
3e5111
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
3e5111
Date: Fri, 9 Jun 2017 12:48:59 +0200
3e5111
Subject: [PATCH] conf: use a leading space in virDomainVirtioNetDriverFormat
3e5111
MIME-Version: 1.0
3e5111
Content-Type: text/plain; charset=UTF-8
3e5111
Content-Transfer-Encoding: 8bit
3e5111
3e5111
Instead of formatting a space after every option.
3e5111
3e5111
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3e5111
(cherry picked from commit d1feb4773d41b928dc1079dfc19d17b5a0e5957b)
3e5111
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3e5111
3e5111
https://bugzilla.redhat.com/show_bug.cgi?id=1283251
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
---
3e5111
 src/conf/domain_conf.c | 18 ++++++++----------
3e5111
 1 file changed, 8 insertions(+), 10 deletions(-)
3e5111
3e5111
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
3e5111
index 701a6d2136..4652e1c72b 100644
3e5111
--- a/src/conf/domain_conf.c
3e5111
+++ b/src/conf/domain_conf.c
3e5111
@@ -22053,29 +22053,27 @@ virDomainVirtioNetDriverFormat(char **outstr,
3e5111
 {
3e5111
     virBuffer buf = VIR_BUFFER_INITIALIZER;
3e5111
     if (def->driver.virtio.name) {
3e5111
-        virBufferAsprintf(&buf, "name='%s' ",
3e5111
+        virBufferAsprintf(&buf, " name='%s'",
3e5111
                           virDomainNetBackendTypeToString(def->driver.virtio.name));
3e5111
     }
3e5111
     if (def->driver.virtio.txmode) {
3e5111
-        virBufferAsprintf(&buf, "txmode='%s' ",
3e5111
+        virBufferAsprintf(&buf, " txmode='%s'",
3e5111
                           virDomainNetVirtioTxModeTypeToString(def->driver.virtio.txmode));
3e5111
     }
3e5111
     if (def->driver.virtio.ioeventfd) {
3e5111
-        virBufferAsprintf(&buf, "ioeventfd='%s' ",
3e5111
+        virBufferAsprintf(&buf, " ioeventfd='%s'",
3e5111
                           virTristateSwitchTypeToString(def->driver.virtio.ioeventfd));
3e5111
     }
3e5111
     if (def->driver.virtio.event_idx) {
3e5111
-        virBufferAsprintf(&buf, "event_idx='%s' ",
3e5111
+        virBufferAsprintf(&buf, " event_idx='%s'",
3e5111
                           virTristateSwitchTypeToString(def->driver.virtio.event_idx));
3e5111
     }
3e5111
     if (def->driver.virtio.queues)
3e5111
-        virBufferAsprintf(&buf, "queues='%u' ", def->driver.virtio.queues);
3e5111
+        virBufferAsprintf(&buf, " queues='%u'", def->driver.virtio.queues);
3e5111
     if (def->driver.virtio.rx_queue_size)
3e5111
-        virBufferAsprintf(&buf, "rx_queue_size='%u' ",
3e5111
+        virBufferAsprintf(&buf, " rx_queue_size='%u'",
3e5111
                           def->driver.virtio.rx_queue_size);
3e5111
 
3e5111
-    virBufferTrim(&buf, " ", -1);
3e5111
-
3e5111
     if (virBufferCheckError(&buf) < 0)
3e5111
         return -1;
3e5111
 
3e5111
@@ -22323,10 +22321,10 @@ virDomainNetDefFormat(virBufferPtr buf,
3e5111
 
3e5111
             if (!gueststr && !hoststr) {
3e5111
                 if (str)
3e5111
-                    virBufferAsprintf(buf, "<driver %s/>\n", str);
3e5111
+                    virBufferAsprintf(buf, "<driver%s/>\n", str);
3e5111
             } else {
3e5111
                 if (str)
3e5111
-                    virBufferAsprintf(buf, "<driver %s>\n", str);
3e5111
+                    virBufferAsprintf(buf, "<driver%s>\n", str);
3e5111
                 else
3e5111
                     virBufferAddLit(buf, "<driver>\n");
3e5111
                 virBufferAdjustIndent(buf, 2);
3e5111
-- 
3e5111
2.13.1
3e5111