[libvirt PATCH] openvswitch: don't delete existing OVS port prior to recreating same port

Daniel P. Berrangé berrange at redhat.com
Tue Jun 8 08:22:18 UTC 2021


On Mon, Jun 07, 2021 at 05:07:17PM -0400, Laine Stump wrote:
> Connecting a tap device to an Open vSwitch is done by adding a "port"
> to the switch with the ovs-vsctl "add-port" command. The port will
> have the same name as the tap device, but it is a separate entity, and
> can survive beyond the destruction of the tap device (although under
> normal circumstances the port will be deleted around the same time the
> tap device is deleted).
> 
> This makes it possible for a port of a particular name to already
> exist at the time libvirt calls ovs-vsctl to add that port. The
> original commit of Open vSwitch support (commit df81004632, libvirt
> 0.9.10, Feb. 2012) used the "--may-exist" option to the add-port
> command to indicate that a port of the desired name might already
> exist, and that it was okay to simply re-use this port (rather than
> failing with an error message).
> 
> Then in commit 33445ce8446d9 (libvirt 1.2.7, April 2014) the command
> was changed to use "--if-exists del-port blah" instead of
> "--may-exist". The reason given was that there was a bug in OVS where
> a stale port would be unusable even though it still existed; the
> workaround was to forcibly delete any existing port prior to adding
> the new port (of the same name). This is the ovs-vsctl command still
> in use by libvirt today.
> 
> It recently came up in the discussion of a bug concerning guest packet
> loss during OpenStack upgrades (https://bugzilla.redhat.com/1963164)
> that the bug in OVS that necessitated the del-port workaround was
> fixed quite a long time ago (August 2015):
> 
>   https://github.com/openvswitch/ovs/commit/e21c6643a02c6b446d2fbdfde366ea303b4c2730
> 
> thus rendering the workaround in libvirt unnecessary. The assertion in
> that discussion is that this workaround is now the cause of the packet
> loss being experienced during OpenStack upgrades. I'm not convinced
> this is the case, but it does appear that there is no reason to carry
> this workaround in libvirt any longer, so this patch reverts the code
> back to the original behavior (using "--may-exist" instead of
> "--if-exists del-port").
> 
> Signed-off-by: Laine Stump <laine at redhat.com>

Reviewed-by: Daniel P. Berrangé <berrange at redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvir-list mailing list