Message ID | 20180101051640.13043-12-blp@ovn.org |
---|---|
State | Accepted |
Delegated to: | Justin Pettit |
Headers | show |
Series | [ovs-dev,01/15] log: Add async commit support. | expand |
Looks good to me, thanks. Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com> On Sun, Dec 31, 2017 at 9:16 PM, Ben Pfaff <blp@ovn.org> wrote: > Signed-off-by: Ben Pfaff <blp@ovn.org> > --- > NEWS | 1 + > ovsdb/ovsdb-client.1.in | 6 ++++++ > ovsdb/ovsdb-client.c | 12 ++++++++++++ > tests/ovs-macros.at | 4 ++++ > 4 files changed, 23 insertions(+) > > diff --git a/NEWS b/NEWS > index dfc2fb7728a4..646879c61677 100644 > --- a/NEWS > +++ b/NEWS > @@ -11,6 +11,7 @@ Post-v2.8.0 > ovsdb-server(5) for more details. > * ovsdb-client: New "get-schema-cksum" and "query" commands. > * ovsdb-client: New "backup" and "restore" commands. > + * ovsdb-client: New --timeout option. > * ovsdb-tool: New "db-name" and "schema-name" commands. > - ovs-vsctl and other commands that display data in tables now support > a > --max-column-width option to limit column width. > diff --git a/ovsdb/ovsdb-client.1.in b/ovsdb/ovsdb-client.1.in > index 56d4797e933c..727e9c6e0651 100644 > --- a/ovsdb/ovsdb-client.1.in > +++ b/ovsdb/ovsdb-client.1.in > @@ -313,6 +313,12 @@ table update. Most output formats add the timestamp > on a line of its own > just above the table. The JSON output format puts the timestamp in a > member of the top-level JSON object named \fBtime\fR. > . > +.IP "\fB\-t\fR" > +.IQ "\fB\-\-timeout=\fIsecs\fR" > +Limits \fBovsdb\-client\fR runtime to approximately \fIsecs\fR > +seconds. If the timeout expires, \fBovsdb\-client\fR will exit with a > +\fBSIGALRM\fR signal. > +. > .SS "Daemon Options" > The daemon options apply only to the \fBmonitor\fR and > \fBmonitor\-cond\fR commands. > With any other command, they have no effect. > diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c > index a7cab600c98b..b00f04147d39 100644 > --- a/ovsdb/ovsdb-client.c > +++ b/ovsdb/ovsdb-client.c > @@ -213,6 +213,7 @@ parse_options(int argc, char *argv[]) > {"force", no_argument, NULL, OPT_FORCE}, > {"db-change-aware", no_argument, &db_change_aware, 1}, > {"no-db-change-aware", no_argument, &db_change_aware, 0}, > + {"timeout", required_argument, NULL, 't'}, > VLOG_LONG_OPTIONS, > DAEMON_LONG_OPTIONS, > #ifdef HAVE_OPENSSL > @@ -227,6 +228,7 @@ parse_options(int argc, char *argv[]) > table_style.format = TF_TABLE; > > for (;;) { > + unsigned long int timeout; > int c; > > c = getopt_long(argc, argv, short_options, long_options, NULL); > @@ -259,6 +261,16 @@ parse_options(int argc, char *argv[]) > force = true; > break; > > + case 't': > + timeout = strtoul(optarg, NULL, 10); > + if (timeout <= 0) { > + ovs_fatal(0, "value %s on -t or --timeout is not at least > 1", > + optarg); > + } else { > + time_alarm(timeout); > + } > + break; > + > case '?': > exit(EXIT_FAILURE); > > diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at > index 56d0a3bca86d..82df193871b3 100644 > --- a/tests/ovs-macros.at > +++ b/tests/ovs-macros.at > @@ -122,6 +122,7 @@ if [ $? -eq 0 ]; then > alias ovn-sbctl='OVS_SBCTL_TIMEOUT' > alias ovn-nbctl='OVN_NBCTL_TIMEOUT' > alias vtep-ctl='VTEP_CTL_TIMEOUT' > + alias ovsdb-client='OVSDB_CLIENT_TIMEOUT' > OVS_OFCTL_TIMEOUT () { > command ovs-ofctl --timeout=$OVS_TIMEOUT "$@" > } > @@ -137,6 +138,9 @@ if [ $? -eq 0 ]; then > VTEP_CTL_TIMEOUT () { > command vtep-ctl --timeout=$OVS_TIMEOUT "$@" > } > + OVSDB_CLIENT_TIMEOUT () { > + command ovsdb-client --timeout=$OVS_TIMEOUT "$@" > + } > fi > > # parent_pid PID > -- > 2.10.2 > > _______________________________________________ > dev mailing list > dev@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev >
Thanks for the review! On Tue, Jan 16, 2018 at 09:12:04AM -0800, Yifeng Sun wrote: > Looks good to me, thanks. > > Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com> > > On Sun, Dec 31, 2017 at 9:16 PM, Ben Pfaff <blp@ovn.org> wrote: > > > Signed-off-by: Ben Pfaff <blp@ovn.org> > > --- > > NEWS | 1 + > > ovsdb/ovsdb-client.1.in | 6 ++++++ > > ovsdb/ovsdb-client.c | 12 ++++++++++++ > > tests/ovs-macros.at | 4 ++++ > > 4 files changed, 23 insertions(+) > > > > diff --git a/NEWS b/NEWS > > index dfc2fb7728a4..646879c61677 100644 > > --- a/NEWS > > +++ b/NEWS > > @@ -11,6 +11,7 @@ Post-v2.8.0 > > ovsdb-server(5) for more details. > > * ovsdb-client: New "get-schema-cksum" and "query" commands. > > * ovsdb-client: New "backup" and "restore" commands. > > + * ovsdb-client: New --timeout option. > > * ovsdb-tool: New "db-name" and "schema-name" commands. > > - ovs-vsctl and other commands that display data in tables now support > > a > > --max-column-width option to limit column width. > > diff --git a/ovsdb/ovsdb-client.1.in b/ovsdb/ovsdb-client.1.in > > index 56d4797e933c..727e9c6e0651 100644 > > --- a/ovsdb/ovsdb-client.1.in > > +++ b/ovsdb/ovsdb-client.1.in > > @@ -313,6 +313,12 @@ table update. Most output formats add the timestamp > > on a line of its own > > just above the table. The JSON output format puts the timestamp in a > > member of the top-level JSON object named \fBtime\fR. > > . > > +.IP "\fB\-t\fR" > > +.IQ "\fB\-\-timeout=\fIsecs\fR" > > +Limits \fBovsdb\-client\fR runtime to approximately \fIsecs\fR > > +seconds. If the timeout expires, \fBovsdb\-client\fR will exit with a > > +\fBSIGALRM\fR signal. > > +. > > .SS "Daemon Options" > > The daemon options apply only to the \fBmonitor\fR and > > \fBmonitor\-cond\fR commands. > > With any other command, they have no effect. > > diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c > > index a7cab600c98b..b00f04147d39 100644 > > --- a/ovsdb/ovsdb-client.c > > +++ b/ovsdb/ovsdb-client.c > > @@ -213,6 +213,7 @@ parse_options(int argc, char *argv[]) > > {"force", no_argument, NULL, OPT_FORCE}, > > {"db-change-aware", no_argument, &db_change_aware, 1}, > > {"no-db-change-aware", no_argument, &db_change_aware, 0}, > > + {"timeout", required_argument, NULL, 't'}, > > VLOG_LONG_OPTIONS, > > DAEMON_LONG_OPTIONS, > > #ifdef HAVE_OPENSSL > > @@ -227,6 +228,7 @@ parse_options(int argc, char *argv[]) > > table_style.format = TF_TABLE; > > > > for (;;) { > > + unsigned long int timeout; > > int c; > > > > c = getopt_long(argc, argv, short_options, long_options, NULL); > > @@ -259,6 +261,16 @@ parse_options(int argc, char *argv[]) > > force = true; > > break; > > > > + case 't': > > + timeout = strtoul(optarg, NULL, 10); > > + if (timeout <= 0) { > > + ovs_fatal(0, "value %s on -t or --timeout is not at least > > 1", > > + optarg); > > + } else { > > + time_alarm(timeout); > > + } > > + break; > > + > > case '?': > > exit(EXIT_FAILURE); > > > > diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at > > index 56d0a3bca86d..82df193871b3 100644 > > --- a/tests/ovs-macros.at > > +++ b/tests/ovs-macros.at > > @@ -122,6 +122,7 @@ if [ $? -eq 0 ]; then > > alias ovn-sbctl='OVS_SBCTL_TIMEOUT' > > alias ovn-nbctl='OVN_NBCTL_TIMEOUT' > > alias vtep-ctl='VTEP_CTL_TIMEOUT' > > + alias ovsdb-client='OVSDB_CLIENT_TIMEOUT' > > OVS_OFCTL_TIMEOUT () { > > command ovs-ofctl --timeout=$OVS_TIMEOUT "$@" > > } > > @@ -137,6 +138,9 @@ if [ $? -eq 0 ]; then > > VTEP_CTL_TIMEOUT () { > > command vtep-ctl --timeout=$OVS_TIMEOUT "$@" > > } > > + OVSDB_CLIENT_TIMEOUT () { > > + command ovsdb-client --timeout=$OVS_TIMEOUT "$@" > > + } > > fi > > > > # parent_pid PID > > -- > > 2.10.2 > > > > _______________________________________________ > > dev mailing list > > dev@openvswitch.org > > https://mail.openvswitch.org/mailman/listinfo/ovs-dev > >
> On Dec 31, 2017, at 9:16 PM, Ben Pfaff <blp@ovn.org> wrote: > > Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org> --Justin
On Mon, Feb 05, 2018 at 02:38:27PM -0800, Justin Pettit wrote: > > > > On Dec 31, 2017, at 9:16 PM, Ben Pfaff <blp@ovn.org> wrote: > > > > Signed-off-by: Ben Pfaff <blp@ovn.org> > > Acked-by: Justin Pettit <jpettit@ovn.org> Thanks.
On Tue, Feb 06, 2018 at 11:14:40AM -0800, Ben Pfaff wrote: > On Mon, Feb 05, 2018 at 02:38:27PM -0800, Justin Pettit wrote: > > > > > > > On Dec 31, 2017, at 9:16 PM, Ben Pfaff <blp@ovn.org> wrote: > > > > > > Signed-off-by: Ben Pfaff <blp@ovn.org> > > > > Acked-by: Justin Pettit <jpettit@ovn.org> Thanks. I applied (only) this patch to master.
diff --git a/NEWS b/NEWS index dfc2fb7728a4..646879c61677 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ Post-v2.8.0 ovsdb-server(5) for more details. * ovsdb-client: New "get-schema-cksum" and "query" commands. * ovsdb-client: New "backup" and "restore" commands. + * ovsdb-client: New --timeout option. * ovsdb-tool: New "db-name" and "schema-name" commands. - ovs-vsctl and other commands that display data in tables now support a --max-column-width option to limit column width. diff --git a/ovsdb/ovsdb-client.1.in b/ovsdb/ovsdb-client.1.in index 56d4797e933c..727e9c6e0651 100644 --- a/ovsdb/ovsdb-client.1.in +++ b/ovsdb/ovsdb-client.1.in @@ -313,6 +313,12 @@ table update. Most output formats add the timestamp on a line of its own just above the table. The JSON output format puts the timestamp in a member of the top-level JSON object named \fBtime\fR. . +.IP "\fB\-t\fR" +.IQ "\fB\-\-timeout=\fIsecs\fR" +Limits \fBovsdb\-client\fR runtime to approximately \fIsecs\fR +seconds. If the timeout expires, \fBovsdb\-client\fR will exit with a +\fBSIGALRM\fR signal. +. .SS "Daemon Options" The daemon options apply only to the \fBmonitor\fR and \fBmonitor\-cond\fR commands. With any other command, they have no effect. diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c index a7cab600c98b..b00f04147d39 100644 --- a/ovsdb/ovsdb-client.c +++ b/ovsdb/ovsdb-client.c @@ -213,6 +213,7 @@ parse_options(int argc, char *argv[]) {"force", no_argument, NULL, OPT_FORCE}, {"db-change-aware", no_argument, &db_change_aware, 1}, {"no-db-change-aware", no_argument, &db_change_aware, 0}, + {"timeout", required_argument, NULL, 't'}, VLOG_LONG_OPTIONS, DAEMON_LONG_OPTIONS, #ifdef HAVE_OPENSSL @@ -227,6 +228,7 @@ parse_options(int argc, char *argv[]) table_style.format = TF_TABLE; for (;;) { + unsigned long int timeout; int c; c = getopt_long(argc, argv, short_options, long_options, NULL); @@ -259,6 +261,16 @@ parse_options(int argc, char *argv[]) force = true; break; + case 't': + timeout = strtoul(optarg, NULL, 10); + if (timeout <= 0) { + ovs_fatal(0, "value %s on -t or --timeout is not at least 1", + optarg); + } else { + time_alarm(timeout); + } + break; + case '?': exit(EXIT_FAILURE); diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at index 56d0a3bca86d..82df193871b3 100644 --- a/tests/ovs-macros.at +++ b/tests/ovs-macros.at @@ -122,6 +122,7 @@ if [ $? -eq 0 ]; then alias ovn-sbctl='OVS_SBCTL_TIMEOUT' alias ovn-nbctl='OVN_NBCTL_TIMEOUT' alias vtep-ctl='VTEP_CTL_TIMEOUT' + alias ovsdb-client='OVSDB_CLIENT_TIMEOUT' OVS_OFCTL_TIMEOUT () { command ovs-ofctl --timeout=$OVS_TIMEOUT "$@" } @@ -137,6 +138,9 @@ if [ $? -eq 0 ]; then VTEP_CTL_TIMEOUT () { command vtep-ctl --timeout=$OVS_TIMEOUT "$@" } + OVSDB_CLIENT_TIMEOUT () { + command ovsdb-client --timeout=$OVS_TIMEOUT "$@" + } fi # parent_pid PID
Signed-off-by: Ben Pfaff <blp@ovn.org> --- NEWS | 1 + ovsdb/ovsdb-client.1.in | 6 ++++++ ovsdb/ovsdb-client.c | 12 ++++++++++++ tests/ovs-macros.at | 4 ++++ 4 files changed, 23 insertions(+)