提交 27761b17 编写于 作者: M Michal Privoznik

virNetDevOpenvswitchConstructVlans: Bring @i into the block where it's used

Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 6752a3ec
...@@ -71,7 +71,6 @@ static int ...@@ -71,7 +71,6 @@ static int
virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, const virNetDevVlan *virtVlan) virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, const virNetDevVlan *virtVlan)
{ {
int ret = -1; int ret = -1;
size_t i = 0;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
if (!virtVlan || !virtVlan->nTags) if (!virtVlan || !virtVlan->nTags)
...@@ -92,6 +91,8 @@ virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, const virNetDevVlan *virtV ...@@ -92,6 +91,8 @@ virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, const virNetDevVlan *virtV
} }
if (virtVlan->trunk) { if (virtVlan->trunk) {
size_t i;
virBufferAddLit(&buf, "trunk="); virBufferAddLit(&buf, "trunk=");
/* /*
...@@ -100,7 +101,7 @@ virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, const virNetDevVlan *virtV ...@@ -100,7 +101,7 @@ virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, const virNetDevVlan *virtV
* start of the for loop if there are more than one VLANs * start of the for loop if there are more than one VLANs
* on this trunk port. * on this trunk port.
*/ */
virBufferAsprintf(&buf, "%d", virtVlan->tag[i]); virBufferAsprintf(&buf, "%d", virtVlan->tag[0]);
for (i = 1; i < virtVlan->nTags; i++) { for (i = 1; i < virtVlan->nTags; i++) {
virBufferAddLit(&buf, ","); virBufferAddLit(&buf, ",");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册