diff --git a/SOURCES/openvswitch-2.17.0.patch b/SOURCES/openvswitch-2.17.0.patch index eadc207..85b36d9 100644 --- a/SOURCES/openvswitch-2.17.0.patch +++ b/SOURCES/openvswitch-2.17.0.patch @@ -72977,6 +72977,100 @@ index 5223aa8970..81f073b1cf 100644 union ovsdb_atom atom; atom.uuid = m->uuid; +diff --git a/vswitchd/ovs-vswitchd.c b/vswitchd/ovs-vswitchd.c +index 407bfc60eb..2b2afb44ca 100644 +--- a/vswitchd/ovs-vswitchd.c ++++ b/vswitchd/ovs-vswitchd.c +@@ -65,19 +65,19 @@ static unixctl_cb_func ovs_vswitchd_exit; + static char *parse_options(int argc, char *argv[], char **unixctl_path); + OVS_NO_RETURN static void usage(void); + +-struct ovs_vswitchd_exit_args { +- bool *exiting; +- bool *cleanup; +-}; ++static struct ovs_vswitchd_exit_args { ++ struct unixctl_conn **conns; ++ size_t n_conns; ++ bool exiting; ++ bool cleanup; ++} exit_args; + + int + main(int argc, char *argv[]) + { +- char *unixctl_path = NULL; + struct unixctl_server *unixctl; ++ char *unixctl_path = NULL; + char *remote; +- bool exiting, cleanup; +- struct ovs_vswitchd_exit_args exit_args = {&exiting, &cleanup}; + int retval; + + set_program_name(argv[0]); +@@ -108,14 +108,12 @@ main(int argc, char *argv[]) + exit(EXIT_FAILURE); + } + unixctl_command_register("exit", "[--cleanup]", 0, 1, +- ovs_vswitchd_exit, &exit_args); ++ ovs_vswitchd_exit, NULL); + + bridge_init(remote); + free(remote); + +- exiting = false; +- cleanup = false; +- while (!exiting) { ++ while (!exit_args.exiting) { + OVS_USDT_PROBE(main, run_start); + memory_run(); + if (memory_should_report()) { +@@ -134,16 +132,22 @@ main(int argc, char *argv[]) + bridge_wait(); + unixctl_server_wait(unixctl); + netdev_wait(); +- if (exiting) { ++ if (exit_args.exiting) { + poll_immediate_wake(); + } + OVS_USDT_PROBE(main, poll_block); + poll_block(); + if (should_service_stop()) { +- exiting = true; ++ exit_args.exiting = true; + } + } +- bridge_exit(cleanup); ++ bridge_exit(exit_args.cleanup); ++ ++ for (size_t i = 0; i < exit_args.n_conns; i++) { ++ unixctl_command_reply(exit_args.conns[i], NULL); ++ } ++ free(exit_args.conns); ++ + unixctl_server_destroy(unixctl); + service_stop(); + vlog_disable_async(); +@@ -295,10 +299,14 @@ usage(void) + + static void + ovs_vswitchd_exit(struct unixctl_conn *conn, int argc, +- const char *argv[], void *exit_args_) ++ const char *argv[], void *args OVS_UNUSED) + { +- struct ovs_vswitchd_exit_args *exit_args = exit_args_; +- *exit_args->exiting = true; +- *exit_args->cleanup = argc == 2 && !strcmp(argv[1], "--cleanup"); +- unixctl_command_reply(conn, NULL); ++ exit_args.n_conns++; ++ exit_args.conns = xrealloc(exit_args.conns, ++ exit_args.n_conns * sizeof *exit_args.conns); ++ exit_args.conns[exit_args.n_conns - 1] = conn; ++ exit_args.exiting = true; ++ if (!exit_args.cleanup) { ++ exit_args.cleanup = argc == 2 && !strcmp(argv[1], "--cleanup"); ++ } + } diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index 0c66326171..0c8534f142 100644 --- a/vswitchd/vswitch.xml diff --git a/SPECS/openvswitch2.17.spec b/SPECS/openvswitch2.17.spec index c685b4f..df027b4 100644 --- a/SPECS/openvswitch2.17.spec +++ b/SPECS/openvswitch2.17.spec @@ -63,7 +63,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 2.17.0 -Release: 106%{?dist} +Release: 107%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -749,6 +749,12 @@ exit 0 %endif %changelog +* Tue Jul 18 2023 Open vSwitch CI - 2.17.0-107 +- Merging upstream branch-2.17 [RH git: c751278219] + Commit list: + 5d976536b3 vswitchd: Wait for a bridge exit before replying to exit unixctl. + + * Tue Jun 27 2023 Open vSwitch CI - 2.17.0-106 - Merging upstream branch-2.17 [RH git: a869eaf6d6] Commit list: