diff options
author | Kyle Mestery <kmestery@cisco.com> | 2012-08-30 16:38:06 -0400 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2012-08-31 10:57:00 +0800 |
commit | 7b9d55e6298ce733db69f217db143975e81fc89f (patch) | |
tree | 3abbb450011dfb207df23b14f9d7f05da9bd85df /src/util | |
parent | Fix xen driver following changes to make it stateful (diff) | |
download | libvirt-7b9d55e6298ce733db69f217db143975e81fc89f.tar.gz libvirt-7b9d55e6298ce733db69f217db143975e81fc89f.tar.bz2 libvirt-7b9d55e6298ce733db69f217db143975e81fc89f.zip |
Fix adding ports to OVS bridges without VLAN tags
The introduction of the new VLAN code, along with the fix
from 5e465df6be8bcb00f0b4bff831e91f4042fae272, caused the
addition of OVS ports to fail with the following message:
ovs-vsctl: 00002|vsctl|ERR|: missing column name
This fix takes into account the VLAN arguments are optional,
and correctly sets up the command line to run the "ovs-vsctl"
command to add ports to the OVS bridge.
Signed-off-by: Kyle Mestery <kmestery@cisco.com>
CC: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/virnetdevopenvswitch.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c index 00271a000..764f478a6 100644 --- a/src/util/virnetdevopenvswitch.c +++ b/src/util/virnetdevopenvswitch.c @@ -104,9 +104,15 @@ int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname, } cmd = virCommandNew(OVSVSCTL); + + virCommandAddArgList(cmd, "--", "--may-exist", "add-port", + brname, ifname, NULL); + + if (virBufferUse(&buf) != 0) + virCommandAddArgList(cmd, virBufferCurrentContent(&buf), NULL); + if (ovsport->profileID[0] == '\0') { - virCommandAddArgList(cmd, "--", "--may-exist", "add-port", - brname, ifname, virBufferCurrentContent(&buf), + virCommandAddArgList(cmd, "--", "set", "Interface", ifname, attachedmac_ex_id, "--", "set", "Interface", ifname, ifaceid_ex_id, "--", "set", "Interface", ifname, vmid_ex_id, @@ -114,8 +120,7 @@ int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname, "external-ids:iface-status=active", NULL); } else { - virCommandAddArgList(cmd, "--", "--may-exist", "add-port", - brname, ifname, virBufferCurrentContent(&buf), + virCommandAddArgList(cmd, "--", "set", "Interface", ifname, attachedmac_ex_id, "--", "set", "Interface", ifname, ifaceid_ex_id, "--", "set", "Interface", ifname, vmid_ex_id, |