From: Ben Pfaff Date: Mon, 6 Jun 2011 18:40:10 +0000 (-0700) Subject: ovs-vsctl: New "comment" command. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffd66ea9e45b52eb4c6289c214cd03e8f2318369;p=openvswitch ovs-vsctl: New "comment" command. This allows processes that call ovs-vsctl to add remarks that explain their intentions. --- diff --git a/utilities/ovs-vsctl.8.in b/utilities/ovs-vsctl.8.in index 88230be3..309ea0af 100644 --- a/utilities/ovs-vsctl.8.in +++ b/utilities/ovs-vsctl.8.in @@ -694,6 +694,9 @@ initially connects to the database. Consider specifying \fB\-\-timeout=0\fR along with \fB\-\-wait\-until\fR, to prevent \fBovs\-vsctl\fR from terminating after waiting only at most 5 seconds. +.IP "\fBcomment \fR[\fIarg\fR]..." +This command has no effect on behavior, but any database log record +created by the command will include the command and its arguments. .SH "EXAMPLES" Create a new bridge named br0 and add port eth0 to it: .IP diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c index 104f65ef..df20f063 100644 --- a/utilities/ovs-vsctl.c +++ b/utilities/ovs-vsctl.c @@ -3592,7 +3592,9 @@ do_vsctl(const char *args, struct vsctl_command *commands, size_t n_commands, struct vsctl_context ctx; vsctl_context_init(&ctx, c, idl, txn, ovs, symtab); - (c->syntax->run)(&ctx); + if (c->syntax->run) { + (c->syntax->run)(&ctx); + } vsctl_context_done(&ctx, c); if (ctx.try_again) { @@ -3786,7 +3788,8 @@ static const struct vsctl_command_syntax all_commands[] = { /* Switch commands. */ {"emer-reset", 0, 0, pre_cmd_emer_reset, cmd_emer_reset, NULL, "", RW}, - /* Parameter commands. */ + /* Database commands. */ + {"comment", 0, INT_MAX, NULL, NULL, NULL, "", RO}, {"get", 2, INT_MAX, pre_cmd_get, cmd_get, NULL, "--if-exists,--id=", RO}, {"list", 1, INT_MAX, pre_cmd_list, cmd_list, NULL, "--columns=", RO}, {"find", 1, INT_MAX, pre_cmd_find, cmd_find, NULL, "--columns=", RO},