[PATCH 2/5] virNetDevOpenvswitchConstructVlans: Bring @i into the block where it's used

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

 



Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/util/virnetdevopenvswitch.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c
index 6c4e817941..c9e0c4e956 100644
--- a/src/util/virnetdevopenvswitch.c
+++ b/src/util/virnetdevopenvswitch.c
@@ -71,7 +71,6 @@ static int
 virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, const virNetDevVlan *virtVlan)
 {
     int ret = -1;
-    size_t i = 0;
     g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
 
     if (!virtVlan || !virtVlan->nTags)
@@ -92,6 +91,8 @@ virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, const virNetDevVlan *virtV
     }
 
     if (virtVlan->trunk) {
+        size_t i;
+
         virBufferAddLit(&buf, "trunk=");
 
         /*
@@ -100,7 +101,7 @@ virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, const virNetDevVlan *virtV
          * start of the for loop if there are more than one VLANs
          * on this trunk port.
          */
-        virBufferAsprintf(&buf, "%d", virtVlan->tag[i]);
+        virBufferAsprintf(&buf, "%d", virtVlan->tag[0]);
 
         for (i = 1; i < virtVlan->nTags; i++) {
             virBufferAddLit(&buf, ",");
-- 
2.26.2




[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