diff options
author | Justin Pettit <jpettit@nicira.com> | 2015-04-09 00:01:44 -0700 |
---|---|---|
committer | Justin Pettit <jpettit@nicira.com> | 2015-04-09 12:31:55 -0700 |
commit | afc9da0b05819db4d87cb2415e6a26e7b6ee3409 (patch) | |
tree | 1f26377a9de4cc71bd575f05c236e18782735c04 | |
parent | 3c78b3ca23830dc1df70f5dc52fa360a6d0bae83 (diff) | |
download | openvswitch-afc9da0b05819db4d87cb2415e6a26e7b6ee3409.tar.gz |
ovn-nbctl: Add OVSDB transaction comment.
Add a comment to the transaction that contains the command that was
executed to aid looking at the transaction log.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
-rw-r--r-- | ovn/ovn-nbctl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ovn/ovn-nbctl.c b/ovn/ovn-nbctl.c index 317810547..3ffe699f3 100644 --- a/ovn/ovn-nbctl.c +++ b/ovn/ovn-nbctl.c @@ -23,6 +23,7 @@ #include "fatal-signal.h" #include "ovn/ovn-nb-idl.h" #include "poll-loop.h" +#include "process.h" #include "stream.h" #include "stream-ssl.h" #include "util.h" @@ -607,6 +608,7 @@ main(int argc, char *argv[]) enum ovsdb_idl_txn_status txn_status; unsigned int seqno; int res = 0; + char *args; fatal_ignore_sigpipe(); set_program_name(argv[0]); @@ -615,6 +617,8 @@ main(int argc, char *argv[]) parse_options(argc, argv); nbrec_init(); + args = process_escape_args(argv); + nb_ctx.idl = ovsdb_idl_create(db, &nbrec_idl_class, true, false); ctx.pvt = &nb_ctx; ctx.argc = argc - optind; @@ -634,6 +638,7 @@ main(int argc, char *argv[]) if (seqno != ovsdb_idl_get_seqno(nb_ctx.idl)) { nb_ctx.txn = ovsdb_idl_txn_create(nb_ctx.idl); + ovsdb_idl_txn_add_comment(nb_ctx.txn, "ovn-nbctl: %s", args); ovs_cmdl_run_command(&ctx, get_all_commands()); txn_status = ovsdb_idl_txn_commit_block(nb_ctx.txn); if (txn_status == TXN_TRY_AGAIN) { @@ -655,6 +660,7 @@ main(int argc, char *argv[]) ovsdb_idl_txn_destroy(nb_ctx.txn); } ovsdb_idl_destroy(nb_ctx.idl); + free(args); exit(res); } |