Skip to content

Commit

Permalink
controller, controller-vtep: Add --unixctl option.
Browse files Browse the repository at this point in the history
All other OVN daemons have the --unixctl option to specify the control
socket file. It was missing from ovn-controller and ovn-controller-vtep,
which this patch fixes.

The ovn-controller-vtep documentation was also missing the already
supported --help and --version options, which are now reflected in the
docs.

Reported-at: https://issues.redhat.com/browse/FDP-714
Signed-off-by: Rosemarie O'Riorden <[email protected]>
  • Loading branch information
roseoriorden committed Jul 29, 2024
1 parent 4d81f1f commit 921c385
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
5 changes: 5 additions & 0 deletions controller-vtep/ovn-controller-vtep.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
<xi:include href="lib/ssl-bootstrap.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="lib/ssl-peer-ca-cert.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>

<h2>Other Options</h2>
<xi:include href="lib/unixctl.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<h3></h3>
<xi:include href="lib/common.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>

<h1>Configuration</h1>
<p>
<code>ovn-controller-vtep</code> retrieves its configuration
Expand Down
11 changes: 10 additions & 1 deletion controller-vtep/ovn-controller-vtep.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ static char *vtep_remote;
static char *ovnsb_remote;
static char *default_db_;

/* --unixctl-path: Path to use for unixctl server socket. */
static char *unixctl_path;

/* Returns true if the northd internal version stored in SB_Global
* and ovn-controller-vtep internal version match.
*/
Expand Down Expand Up @@ -118,7 +121,7 @@ main(int argc, char *argv[])

daemonize_start(false, false);

char *abs_unixctl_path = get_abs_unix_ctl_path(NULL);
char *abs_unixctl_path = get_abs_unix_ctl_path(unixctl_path);
retval = unixctl_server_create(abs_unixctl_path, &unixctl);
free(abs_unixctl_path);

Expand Down Expand Up @@ -287,6 +290,7 @@ parse_options(int argc, char *argv[])
{"vtep-db", required_argument, NULL, 'D'},
{"help", no_argument, NULL, 'h'},
{"version", no_argument, NULL, 'V'},
{"unixctl", required_argument, NULL, 'u'},
VLOG_LONG_OPTIONS,
OVN_DAEMON_LONG_OPTIONS,
STREAM_SSL_LONG_OPTIONS,
Expand Down Expand Up @@ -322,6 +326,10 @@ parse_options(int argc, char *argv[])
ovn_print_version(OFP13_VERSION, OFP13_VERSION);
exit(EXIT_SUCCESS);

case 'u':
unixctl_path = optarg;
break;

VLOG_OPTION_HANDLERS
OVN_DAEMON_OPTION_HANDLERS
STREAM_SSL_OPTION_HANDLERS
Expand Down Expand Up @@ -364,6 +372,7 @@ Options:\n\
(default: %s)\n\
--ovnsb-db=DATABASE connect to ovn-sb database at DATABASE\n\
(default: %s)\n\
-u, --unixctl=SOCKET set control socket name\n\
-h, --help display this help message\n\
-o, --options list available options\n\
-V, --version display version information\n\
Expand Down
3 changes: 2 additions & 1 deletion controller/ovn-controller.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
<xi:include href="lib/ssl-peer-ca-cert.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>

<h2>Other Options</h2>

<xi:include href="lib/unixctl.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<h3></h3>
<xi:include href="lib/common.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>


Expand Down
11 changes: 10 additions & 1 deletion controller/ovn-controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ static const char *ssl_private_key_file;
static const char *ssl_certificate_file;
static const char *ssl_ca_cert_file;

/* --unixctl-path: Path to use for unixctl server socket. */
static char *unixctl_path;

/* By default don't set an upper bound for the lflow cache and enable auto
* trimming above 10K logical flows when reducing cache size by 50%.
*/
Expand Down Expand Up @@ -4835,7 +4838,7 @@ main(int argc, char *argv[])

daemonize_start(true, false);

char *abs_unixctl_path = get_abs_unix_ctl_path(NULL);
char *abs_unixctl_path = get_abs_unix_ctl_path(unixctl_path);
retval = unixctl_server_create(abs_unixctl_path, &unixctl);
free(abs_unixctl_path);
if (retval) {
Expand Down Expand Up @@ -5957,6 +5960,7 @@ parse_options(int argc, char *argv[])
static struct option long_options[] = {
{"help", no_argument, NULL, 'h'},
{"version", no_argument, NULL, 'V'},
{"unixctl", required_argument, NULL, 'u'},
VLOG_LONG_OPTIONS,
OVN_DAEMON_LONG_OPTIONS,
STREAM_SSL_LONG_OPTIONS,
Expand Down Expand Up @@ -5986,6 +5990,10 @@ parse_options(int argc, char *argv[])
printf("SB DB Schema %s\n", sbrec_get_db_version());
exit(EXIT_SUCCESS);

case 'u':
unixctl_path = optarg;
break;

VLOG_OPTION_HANDLERS
OVN_DAEMON_OPTION_HANDLERS

Expand Down Expand Up @@ -6061,6 +6069,7 @@ usage(void)
daemon_usage();
vlog_usage();
printf("\nOther options:\n"
" -u, --unixctl=SOCKET set control socket name\n"
" -n custom chassis name\n"
" -h, --help display this help message\n"
" -V, --version display version information\n");
Expand Down

0 comments on commit 921c385

Please sign in to comment.