Message ID | 20240109225142.1987981-10-i.maximets@ovn.org |
---|---|
State | Accepted |
Commit | 37ab57b41c0b5e60b67e126a3114345a3da9eac2 |
Delegated to: | Ilya Maximets |
Headers | show |
Series | ovsdb-server: Configuration via config-file. | expand |
Context | Check | Description |
---|---|---|
ovsrobot/apply-robot | success | apply and check: success |
ovsrobot/github-robot-_Build_and_Test | success | github build: passed |
On 1/9/24 23:49, Ilya Maximets wrote: > It is currently not possible for the role to change in runtime > (unless a manual DB transaction is crafted), but it will be with > addition of a config file. > > If the role changes, listening socket will be closed, and all > the connections to this remote will be terminated. > > Signed-off-by: Ilya Maximets <i.maximets@ovn.org> > --- > ovsdb/jsonrpc-server.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/ovsdb/jsonrpc-server.c b/ovsdb/jsonrpc-server.c > index 81e9e48a0..f3b4961f3 100644 > --- a/ovsdb/jsonrpc-server.c > +++ b/ovsdb/jsonrpc-server.c > @@ -330,7 +330,8 @@ ovsdb_jsonrpc_server_set_remotes(struct ovsdb_jsonrpc_server *svr, > if (!options) { > VLOG_INFO("%s: remote deconfigured", node->name); > ovsdb_jsonrpc_server_del_remote(node); > - } else if (options->dscp != remote->dscp) { > + } else if (options->dscp != remote->dscp > + || !nullable_string_is_equal(options->role, remote->role)) { I don't think it makes a huge difference but to make it indent a bit better I would've added another "else if ()". Up to you though: Acked-by: Dumitru Ceara <dceara@redhat.com> > ovsdb_jsonrpc_server_del_remote(node); > } > }
diff --git a/ovsdb/jsonrpc-server.c b/ovsdb/jsonrpc-server.c index 81e9e48a0..f3b4961f3 100644 --- a/ovsdb/jsonrpc-server.c +++ b/ovsdb/jsonrpc-server.c @@ -330,7 +330,8 @@ ovsdb_jsonrpc_server_set_remotes(struct ovsdb_jsonrpc_server *svr, if (!options) { VLOG_INFO("%s: remote deconfigured", node->name); ovsdb_jsonrpc_server_del_remote(node); - } else if (options->dscp != remote->dscp) { + } else if (options->dscp != remote->dscp + || !nullable_string_is_equal(options->role, remote->role)) { ovsdb_jsonrpc_server_del_remote(node); } }
It is currently not possible for the role to change in runtime (unless a manual DB transaction is crafted), but it will be with addition of a config file. If the role changes, listening socket will be closed, and all the connections to this remote will be terminated. Signed-off-by: Ilya Maximets <i.maximets@ovn.org> --- ovsdb/jsonrpc-server.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)