summaryrefslogtreecommitdiff
path: root/utilities
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-06-06 11:40:10 -0700
committerBen Pfaff <blp@nicira.com>2011-06-07 17:05:42 -0700
commitffd66ea9e45b52eb4c6289c214cd03e8f2318369 (patch)
treeda56041a990b84fab34e188c13fdac7317362819 /utilities
parentdfeb90478917b7848c89efcc6e1674f992f1ec84 (diff)
downloadopenvswitch-ffd66ea9e45b52eb4c6289c214cd03e8f2318369.tar.gz
ovs-vsctl: New "comment" command.
This allows processes that call ovs-vsctl to add remarks that explain their intentions.
Diffstat (limited to 'utilities')
-rw-r--r--utilities/ovs-vsctl.8.in3
-rw-r--r--utilities/ovs-vsctl.c7
2 files changed, 8 insertions, 2 deletions
diff --git a/utilities/ovs-vsctl.8.in b/utilities/ovs-vsctl.8.in
index 88230be3d..309ea0af7 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 104f65eff..df20f063f 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},