From: Ben Pfaff Date: Mon, 28 Feb 2011 20:45:16 +0000 (-0800) Subject: ovs-vsctl: Check for uncreated symbols earlier. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28a3b753fa850e6a052126a061749d6539550fd8;p=openvswitch ovs-vsctl: Check for uncreated symbols earlier. The check for uncreated symbols does not rely on anything that happens during transaction commit, so there is no point in allowing the transaction to be sent to the database server, only to fail there, before reporting the problem locally. --- diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c index 4435f41d..5de5f926 100644 --- a/utilities/ovs-vsctl.c +++ b/utilities/ovs-vsctl.c @@ -3395,6 +3395,12 @@ do_vsctl(const char *args, struct vsctl_command *commands, size_t n_commands, } } + unused = ovsdb_symbol_table_find_unused(symtab); + if (unused) { + vsctl_fatal("row id \"%s\" is referenced but never created (e.g. " + "with \"-- --id=%s create ...\")", unused, unused); + } + status = ovsdb_idl_txn_commit_block(txn); if (wait_for_reload && status == TXN_SUCCESS) { next_cfg = ovsdb_idl_txn_get_increment_new_value(txn); @@ -3414,12 +3420,6 @@ do_vsctl(const char *args, struct vsctl_command *commands, size_t n_commands, ovsdb_idl_txn_destroy(txn); txn = the_idl_txn = NULL; - unused = ovsdb_symbol_table_find_unused(symtab); - if (unused) { - vsctl_fatal("row id \"%s\" is referenced but never created (e.g. " - "with \"-- --id=%s create ...\")", unused, unused); - } - switch (status) { case TXN_INCOMPLETE: NOT_REACHED();