aboutsummaryrefslogtreecommitdiff
path: root/utilities
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-02-28 12:45:16 -0800
committerBen Pfaff <blp@nicira.com>2011-03-10 11:23:59 -0800
commit28a3b753fa850e6a052126a061749d6539550fd8 (patch)
tree203a9dcf270cee3cfc6a8dfa4b0f4ce372044d8f /utilities
parent19b48a816b9af445ff71269ba7219b64f763ca18 (diff)
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.
Diffstat (limited to 'utilities')
-rw-r--r--utilities/ovs-vsctl.c12
1 files changed, 6 insertions, 6 deletions
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();