]> git.feebdaed.xyz Git - 0xmirror/ovs.git/commit
ovs-vsctl: Exit with error if postdb checks report errors.
authorFlavio Leitner <fbl@sysclose.org>
Sun, 13 Jul 2025 22:07:17 +0000 (19:07 -0300)
committerIlya Maximets <i.maximets@ovn.org>
Tue, 15 Jul 2025 16:05:32 +0000 (18:05 +0200)
commit943f9096e2eab95b8abc4e6910001bada13cb88e
tree454c1d7a5bbaf7a245417652e606b667f292e572
parent0add983b38e42ac4e71a94e8cccbed8405aec1d8
ovs-vsctl: Exit with error if postdb checks report errors.

Today the exit code refers to the execution of the change
in the database. However, when not using parameter --no-wait
(default), the ovs-vsctl also checks if OVSDB transactions
are successfully recorded and reload by ovs-vswitchd. In this
case, an error message is printed if there is a problem during
the reload, like for example the one below:

 # ovs-vsctl add-port br0 gre0 -- \
    set interface gre0 type=ip6gre options:key=100 \
    options:remote_ip=2001::2
 ovs-vsctl: Error detected while setting up 'gre0': could not \
 add network device gre0 to ofproto (Address family not supported\
 by protocol).  See ovs-vswitchd log for details.
 ovs-vsctl: The default log directory is "/var/log/openvswitch".
 # echo $?
 0

This patch changes to exit with specific error code 160
(ERROR_BAD_ARGUMENTS) on Windows and 65 (EX_DATAERR) on
Linux or BSD if errors were reported during the reload.

This change may break existing scripts because ovs-vsctl will
start to fail when before it was succeeding. However, if an
error is printed, then it is likely that the change was not
functional anyway.

Reported-at: https://issues.redhat.com/browse/FDP-793
Signed-off-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
NEWS
tests/ovs-vsctl.at
tests/ovs-vswitchd.at
tests/system-afxdp.at
tests/tunnel.at
utilities/ovs-vsctl.8.in
utilities/ovs-vsctl.c