Re: [ovs-dev] [PATCH] Add unixctl option for ovn-northd
It didn't seem like this is different from the original version, so I just cherry-picked that back to branch-2.9. Let me know if I missed something. --Justin > On Mar 11, 2019, at 11:35 AM, Mark Michelson wrote: > > From: Venkata Anil > > This is a backport to the 2.9 branch of the feature. > > Openstack is requesting this backport in order to have their functional > suite for OSP13 work properly with OVS 2.9. > > Signed-off-by: Venkata Anil > Signed-off-by: Ben Pfaff > --- > lib/automake.mk | 3 ++- > lib/unixctl.xml | 26 ++ > ovn/northd/ovn-northd.8.xml | 7 +-- > ovn/northd/ovn-northd.c | 9 - > tests/ovn-northd.at | 39 +++ > 5 files changed, 80 insertions(+), 4 deletions(-) > create mode 100644 lib/unixctl.xml > > diff --git a/lib/automake.mk b/lib/automake.mk > index 70461ec8c..73bc4b219 100644 > --- a/lib/automake.mk > +++ b/lib/automake.mk > @@ -459,7 +459,8 @@ EXTRA_DIST += \ > lib/ssl.xml \ > lib/ssl-bootstrap.xml \ > lib/table.xml \ > - lib/vlog.xml > + lib/vlog.xml \ > + lib/unixctl.xml > > MAN_FRAGMENTS += \ > lib/colors.man \ > diff --git a/lib/unixctl.xml b/lib/unixctl.xml > new file mode 100644 > index 0..51bfc5faa > --- /dev/null > +++ b/lib/unixctl.xml > @@ -0,0 +1,26 @@ > + > + > + --unixctl=socket > + > +Sets the name of the control socket on which > +program listens for runtime management commands > +(see RUNTIME MANAGEMENT COMMANDS, below). If > socket > +does not begin with /, it is interpreted as relative to > +@RUNDIR@. If --unixctl is not used at all, > +the default socket is > +@RUNDIR@/program.pid.ctl, > +where pid is program's process ID. > + > +On Windows a local named pipe is used to listen for runtime management > +commands. A file is created in the absolute path as pointed by > +socket or if --unixctl is not used at all, > +a file is created as program in the configured > +OVS_RUNDIR directory. The file exists just to mimic the > +behavior of a Unix domain socket. > + > + > +Specifying none for socket disables the control > +socket feature. > + > + > + > diff --git a/ovn/northd/ovn-northd.8.xml b/ovn/northd/ovn-northd.8.xml > index 78df522c9..10ae42cfa 100644 > --- a/ovn/northd/ovn-northd.8.xml > +++ b/ovn/northd/ovn-northd.8.xml > @@ -54,8 +54,11 @@ > xmlns:xi="http://www.w3.org/2003/XInclude"/> > > Other Options > - > - xmlns:xi="http://www.w3.org/2003/XInclude"/> > + + xmlns:xi="http://www.w3.org/2003/XInclude"/> > + > + + xmlns:xi="http://www.w3.org/2003/XInclude"/> > > Runtime Management Commands > > diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c > index 82a962b5f..0059cef5d 100644 > --- a/ovn/northd/ovn-northd.c > +++ b/ovn/northd/ovn-northd.c > @@ -59,6 +59,7 @@ struct northd_context { > > static const char *ovnnb_db; > static const char *ovnsb_db; > +static const char *unixctl_path; > > #define MAC_ADDR_PREFIX 0x0A00ULL > #define MAC_ADDR_SPACE 0xff > @@ -239,6 +240,7 @@ Options:\n\ > (default: %s)\n\ > --ovnsb-db=DATABASE connect to ovn-sb database at DATABASE\n\ > (default: %s)\n\ > + --unixctl=SOCKET override default control socket name\n\ > -h, --helpdisplay this help message\n\ > -o, --options list available options\n\ > -V, --version display version information\n\ > @@ -6701,6 +6703,7 @@ parse_options(int argc OVS_UNUSED, char *argv[] > OVS_UNUSED) > static const struct option long_options[] = { > {"ovnsb-db", required_argument, NULL, 'd'}, > {"ovnnb-db", required_argument, NULL, 'D'}, > +{"unixctl", required_argument, NULL, 'u'}, > {"help", no_argument, NULL, 'h'}, > {"options", no_argument, NULL, 'o'}, > {"version", no_argument, NULL, 'V'}, > @@ -6732,6 +6735,10 @@ parse_options(int argc OVS_UNUSED, char *argv[] > OVS_UNUSED) > ovnnb_db = optarg; > break; > > +case 'u': > +unixctl_path = optarg; > +break; > + > case 'h': > usage(); > exit(EXIT_SUCCESS); > @@ -6784,7 +6791,7 @@ main(int argc, char *argv[]) > > daemonize_start(false); > > -retval = unixctl_server_create(NULL, ); > +retval = unixctl_server_create(unixctl_path, ); > if (retval) { > exit(EXIT_FAILURE); > } > diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at > index baa2add41..1878eb2df 100644 > --- a/tests/ovn-northd.at > +++ b/tests/ovn-northd.at > @@ -262,3 +262,42 @@ AT_CHECK_UNQUOTED([ovn-sbctl get Port_Binding ${uuid} > options:ipv6_ra_prefixes], > ]) > > AT_CLEANUP > + > +AT_SETUP([ovn -- test unixctl]) > +ovn_init_db ovn-sb; ovn-sbctl init > +ovn_init_db ovn-nb; ovn-nbctl init >
[ovs-dev] [PATCH] Add unixctl option for ovn-northd
From: Venkata Anil This is a backport to the 2.9 branch of the feature. Openstack is requesting this backport in order to have their functional suite for OSP13 work properly with OVS 2.9. Signed-off-by: Venkata Anil Signed-off-by: Ben Pfaff --- lib/automake.mk | 3 ++- lib/unixctl.xml | 26 ++ ovn/northd/ovn-northd.8.xml | 7 +-- ovn/northd/ovn-northd.c | 9 - tests/ovn-northd.at | 39 +++ 5 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 lib/unixctl.xml diff --git a/lib/automake.mk b/lib/automake.mk index 70461ec8c..73bc4b219 100644 --- a/lib/automake.mk +++ b/lib/automake.mk @@ -459,7 +459,8 @@ EXTRA_DIST += \ lib/ssl.xml \ lib/ssl-bootstrap.xml \ lib/table.xml \ - lib/vlog.xml + lib/vlog.xml \ + lib/unixctl.xml MAN_FRAGMENTS += \ lib/colors.man \ diff --git a/lib/unixctl.xml b/lib/unixctl.xml new file mode 100644 index 0..51bfc5faa --- /dev/null +++ b/lib/unixctl.xml @@ -0,0 +1,26 @@ + + + --unixctl=socket + +Sets the name of the control socket on which +program listens for runtime management commands +(see RUNTIME MANAGEMENT COMMANDS, below). If socket +does not begin with /, it is interpreted as relative to +@RUNDIR@. If --unixctl is not used at all, +the default socket is +@RUNDIR@/program.pid.ctl, +where pid is program's process ID. + +On Windows a local named pipe is used to listen for runtime management +commands. A file is created in the absolute path as pointed by +socket or if --unixctl is not used at all, +a file is created as program in the configured +OVS_RUNDIR directory. The file exists just to mimic the +behavior of a Unix domain socket. + + +Specifying none for socket disables the control +socket feature. + + + diff --git a/ovn/northd/ovn-northd.8.xml b/ovn/northd/ovn-northd.8.xml index 78df522c9..10ae42cfa 100644 --- a/ovn/northd/ovn-northd.8.xml +++ b/ovn/northd/ovn-northd.8.xml @@ -54,8 +54,11 @@ http://www.w3.org/2003/XInclude"/> Other Options - -http://www.w3.org/2003/XInclude"/> +http://www.w3.org/2003/XInclude"/> + +http://www.w3.org/2003/XInclude"/> Runtime Management Commands diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c index 82a962b5f..0059cef5d 100644 --- a/ovn/northd/ovn-northd.c +++ b/ovn/northd/ovn-northd.c @@ -59,6 +59,7 @@ struct northd_context { static const char *ovnnb_db; static const char *ovnsb_db; +static const char *unixctl_path; #define MAC_ADDR_PREFIX 0x0A00ULL #define MAC_ADDR_SPACE 0xff @@ -239,6 +240,7 @@ Options:\n\ (default: %s)\n\ --ovnsb-db=DATABASE connect to ovn-sb database at DATABASE\n\ (default: %s)\n\ + --unixctl=SOCKET override default control socket name\n\ -h, --helpdisplay this help message\n\ -o, --options list available options\n\ -V, --version display version information\n\ @@ -6701,6 +6703,7 @@ parse_options(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) static const struct option long_options[] = { {"ovnsb-db", required_argument, NULL, 'd'}, {"ovnnb-db", required_argument, NULL, 'D'}, +{"unixctl", required_argument, NULL, 'u'}, {"help", no_argument, NULL, 'h'}, {"options", no_argument, NULL, 'o'}, {"version", no_argument, NULL, 'V'}, @@ -6732,6 +6735,10 @@ parse_options(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) ovnnb_db = optarg; break; +case 'u': +unixctl_path = optarg; +break; + case 'h': usage(); exit(EXIT_SUCCESS); @@ -6784,7 +6791,7 @@ main(int argc, char *argv[]) daemonize_start(false); -retval = unixctl_server_create(NULL, ); +retval = unixctl_server_create(unixctl_path, ); if (retval) { exit(EXIT_FAILURE); } diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at index baa2add41..1878eb2df 100644 --- a/tests/ovn-northd.at +++ b/tests/ovn-northd.at @@ -262,3 +262,42 @@ AT_CHECK_UNQUOTED([ovn-sbctl get Port_Binding ${uuid} options:ipv6_ra_prefixes], ]) AT_CLEANUP + +AT_SETUP([ovn -- test unixctl]) +ovn_init_db ovn-sb; ovn-sbctl init +ovn_init_db ovn-nb; ovn-nbctl init + +# test unixctl option +mkdir "$ovs_base"/northd +as northd start_daemon ovn-northd --unixctl="$ovs_base"/northd/ovn-northd.ctl --ovnnb-db=unix:"$ovs_base"/ovn-nb/ovn-nb.sock --ovnsb-db=unix:"$ovs_base"/ovn-sb/ovn-sb.sock +ovn-nbctl ls-add sw +ovn-nbctl --wait=sb lsp-add sw p1 +# northd created with unixctl option successfully created port_binding entry +AT_CHECK([ovn-sbctl --bare --columns datapath find port_binding logical_port="p1" | wc -l], [0], [1 +]) +AT_CHECK([ovn-nbctl --wait=sb lsp-del
Re: [ovs-dev] [PATCH] Add unixctl option for ovn-northd
On Tue, Jan 30, 2018 at 03:12:32PM +0530, vkomm...@redhat.com wrote: > From: Venkata Anil> > Signed-off-by: Venkata Anil Thanks, applied to master! ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] Add unixctl option for ovn-northd
This is required for spawning ovn-northd for networking-ovn functional tests i.e https://review.openstack.org/#/c/532440/ https://review.openstack.org/#/c/532440/11/networking_ovn/tests/functional/resources/process.py@60 https://review.openstack.org/#/c/532440/11/networking_ovn/tests/functional/resources/process.py@95 Thanks Anil On Tue, Jan 30, 2018 at 3:12 PM,wrote: > From: Venkata Anil > > Signed-off-by: Venkata Anil > --- > lib/automake.mk | 3 ++- > lib/unixctl.xml | 26 ++ > ovn/northd/ovn-northd.8.xml | 7 +-- > ovn/northd/ovn-northd.c | 9 - > tests/ovn-northd.at | 39 +++ > 5 files changed, 80 insertions(+), 4 deletions(-) > create mode 100644 lib/unixctl.xml > > diff --git a/lib/automake.mk b/lib/automake.mk > index 159319f..38d2a99 100644 > --- a/lib/automake.mk > +++ b/lib/automake.mk > @@ -455,7 +455,8 @@ EXTRA_DIST += \ > lib/ssl.xml \ > lib/ssl-bootstrap.xml \ > lib/table.xml \ > - lib/vlog.xml > + lib/vlog.xml \ > + lib/unixctl.xml > > MAN_FRAGMENTS += \ > lib/colors.man \ > diff --git a/lib/unixctl.xml b/lib/unixctl.xml > new file mode 100644 > index 000..51bfc5f > --- /dev/null > +++ b/lib/unixctl.xml > @@ -0,0 +1,26 @@ > + > + > + --unixctl=socket > + > +Sets the name of the control socket on which > +program listens for runtime management > commands > +(see RUNTIME MANAGEMENT COMMANDS, below). If > socket > +does not begin with /, it is interpreted as relative to > +@RUNDIR@. If --unixctl is not used at all, > +the default socket is > +@RUNDIR@/program.pid< > code>.ctl, > +where pid is program's process ID. > + > +On Windows a local named pipe is used to listen for runtime management > +commands. A file is created in the absolute path as pointed by > +socket or if --unixctl is not used at all, > +a file is created as program in the > configured > +OVS_RUNDIR directory. The file exists just to mimic the > +behavior of a Unix domain socket. > + > + > +Specifying none for socket disables the > control > +socket feature. > + > + > + > diff --git a/ovn/northd/ovn-northd.8.xml b/ovn/northd/ovn-northd.8.xml > index ee9cf8c..6bc2dd6 100644 > --- a/ovn/northd/ovn-northd.8.xml > +++ b/ovn/northd/ovn-northd.8.xml > @@ -54,8 +54,11 @@ > http://www.w3.org/ > 2003/XInclude"/> > > Other Options > - > -http://www.w3.org/ > 2003/XInclude"/> > + + xmlns:xi="http://www.w3.org/2003/XInclude"/> > + > + + xmlns:xi="http://www.w3.org/2003/XInclude"/> > > Runtime Management Commands > > diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c > index f4edd8f..e206e0a 100644 > --- a/ovn/northd/ovn-northd.c > +++ b/ovn/northd/ovn-northd.c > @@ -59,6 +59,7 @@ struct northd_context { > > static const char *ovnnb_db; > static const char *ovnsb_db; > +static const char *unixctl_path; > > #define MAC_ADDR_PREFIX 0x0A00ULL > #define MAC_ADDR_SPACE 0xff > @@ -239,6 +240,7 @@ Options:\n\ > (default: %s)\n\ >--ovnsb-db=DATABASE connect to ovn-sb database at DATABASE\n\ > (default: %s)\n\ > + --unixctl = SOCKET override default control socket name\n\ >-h, --helpdisplay this help message\n\ >-o, --options list available options\n\ >-V, --version display version information\n\ > @@ -6663,6 +6665,7 @@ parse_options(int argc OVS_UNUSED, char *argv[] > OVS_UNUSED) > static const struct option long_options[] = { > {"ovnsb-db", required_argument, NULL, 'd'}, > {"ovnnb-db", required_argument, NULL, 'D'}, > +{"unixctl", required_argument, NULL, 'u'}, > {"help", no_argument, NULL, 'h'}, > {"options", no_argument, NULL, 'o'}, > {"version", no_argument, NULL, 'V'}, > @@ -6694,6 +6697,10 @@ parse_options(int argc OVS_UNUSED, char *argv[] > OVS_UNUSED) > ovnnb_db = optarg; > break; > > +case 'u': > +unixctl_path = optarg; > +break; > + > case 'h': > usage(); > exit(EXIT_SUCCESS); > @@ -6746,7 +6753,7 @@ main(int argc, char *argv[]) > > daemonize_start(false); > > -retval = unixctl_server_create(NULL, ); > +retval = unixctl_server_create(unixctl_path, ); > if (retval) { > exit(EXIT_FAILURE); > } > diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at > index baa2add..1878eb2 100644 > --- a/tests/ovn-northd.at > +++ b/tests/ovn-northd.at > @@ -262,3 +262,42 @@ AT_CHECK_UNQUOTED([ovn-sbctl get Port_Binding ${uuid} > options:ipv6_ra_prefixes], > ]) > > AT_CLEANUP > + > +AT_SETUP([ovn -- test unixctl]) > +ovn_init_db ovn-sb; ovn-sbctl init >
[ovs-dev] [PATCH] Add unixctl option for ovn-northd
From: Venkata AnilSigned-off-by: Venkata Anil --- lib/automake.mk | 3 ++- lib/unixctl.xml | 26 ++ ovn/northd/ovn-northd.8.xml | 7 +-- ovn/northd/ovn-northd.c | 9 - tests/ovn-northd.at | 39 +++ 5 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 lib/unixctl.xml diff --git a/lib/automake.mk b/lib/automake.mk index 159319f..38d2a99 100644 --- a/lib/automake.mk +++ b/lib/automake.mk @@ -455,7 +455,8 @@ EXTRA_DIST += \ lib/ssl.xml \ lib/ssl-bootstrap.xml \ lib/table.xml \ - lib/vlog.xml + lib/vlog.xml \ + lib/unixctl.xml MAN_FRAGMENTS += \ lib/colors.man \ diff --git a/lib/unixctl.xml b/lib/unixctl.xml new file mode 100644 index 000..51bfc5f --- /dev/null +++ b/lib/unixctl.xml @@ -0,0 +1,26 @@ + + + --unixctl=socket + +Sets the name of the control socket on which +program listens for runtime management commands +(see RUNTIME MANAGEMENT COMMANDS, below). If socket +does not begin with /, it is interpreted as relative to +@RUNDIR@. If --unixctl is not used at all, +the default socket is +@RUNDIR@/program.pid.ctl, +where pid is program's process ID. + +On Windows a local named pipe is used to listen for runtime management +commands. A file is created in the absolute path as pointed by +socket or if --unixctl is not used at all, +a file is created as program in the configured +OVS_RUNDIR directory. The file exists just to mimic the +behavior of a Unix domain socket. + + +Specifying none for socket disables the control +socket feature. + + + diff --git a/ovn/northd/ovn-northd.8.xml b/ovn/northd/ovn-northd.8.xml index ee9cf8c..6bc2dd6 100644 --- a/ovn/northd/ovn-northd.8.xml +++ b/ovn/northd/ovn-northd.8.xml @@ -54,8 +54,11 @@ http://www.w3.org/2003/XInclude"/> Other Options - -http://www.w3.org/2003/XInclude"/> +http://www.w3.org/2003/XInclude"/> + +http://www.w3.org/2003/XInclude"/> Runtime Management Commands diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c index f4edd8f..e206e0a 100644 --- a/ovn/northd/ovn-northd.c +++ b/ovn/northd/ovn-northd.c @@ -59,6 +59,7 @@ struct northd_context { static const char *ovnnb_db; static const char *ovnsb_db; +static const char *unixctl_path; #define MAC_ADDR_PREFIX 0x0A00ULL #define MAC_ADDR_SPACE 0xff @@ -239,6 +240,7 @@ Options:\n\ (default: %s)\n\ --ovnsb-db=DATABASE connect to ovn-sb database at DATABASE\n\ (default: %s)\n\ + --unixctl = SOCKET override default control socket name\n\ -h, --helpdisplay this help message\n\ -o, --options list available options\n\ -V, --version display version information\n\ @@ -6663,6 +6665,7 @@ parse_options(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) static const struct option long_options[] = { {"ovnsb-db", required_argument, NULL, 'd'}, {"ovnnb-db", required_argument, NULL, 'D'}, +{"unixctl", required_argument, NULL, 'u'}, {"help", no_argument, NULL, 'h'}, {"options", no_argument, NULL, 'o'}, {"version", no_argument, NULL, 'V'}, @@ -6694,6 +6697,10 @@ parse_options(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) ovnnb_db = optarg; break; +case 'u': +unixctl_path = optarg; +break; + case 'h': usage(); exit(EXIT_SUCCESS); @@ -6746,7 +6753,7 @@ main(int argc, char *argv[]) daemonize_start(false); -retval = unixctl_server_create(NULL, ); +retval = unixctl_server_create(unixctl_path, ); if (retval) { exit(EXIT_FAILURE); } diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at index baa2add..1878eb2 100644 --- a/tests/ovn-northd.at +++ b/tests/ovn-northd.at @@ -262,3 +262,42 @@ AT_CHECK_UNQUOTED([ovn-sbctl get Port_Binding ${uuid} options:ipv6_ra_prefixes], ]) AT_CLEANUP + +AT_SETUP([ovn -- test unixctl]) +ovn_init_db ovn-sb; ovn-sbctl init +ovn_init_db ovn-nb; ovn-nbctl init + +# test unixctl option +mkdir "$ovs_base"/northd +as northd start_daemon ovn-northd --unixctl="$ovs_base"/northd/ovn-northd.ctl --ovnnb-db=unix:"$ovs_base"/ovn-nb/ovn-nb.sock --ovnsb-db=unix:"$ovs_base"/ovn-sb/ovn-sb.sock +ovn-nbctl ls-add sw +ovn-nbctl --wait=sb lsp-add sw p1 +# northd created with unixctl option successfully created port_binding entry +AT_CHECK([ovn-sbctl --bare --columns datapath find port_binding logical_port="p1" | wc -l], [0], [1 +]) +AT_CHECK([ovn-nbctl --wait=sb lsp-del p1]) + +# ovs-appctl exit with unixctl option +OVS_APP_EXIT_AND_WAIT_BY_TARGET(["$ovs_base"/northd/ovn-northd.ctl], ["$ovs_base"/northd/ovn-northd.pid]) + +# Check no