diff options
author | Ben Pfaff <blp@nicira.com> | 2011-03-01 13:11:56 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2011-03-10 11:24:00 -0800 |
commit | 0dc66db95bdceeaac2e32b581d2494fd773b17ae (patch) | |
tree | e2f26d614a676965e19b0bbad4d49ce2dfdaf36a /utilities | |
parent | e9387de4a2601ed2768baaa9bc92a3ef27f1145a (diff) |
ovsdb-data: Expose guts of ovsdb_symbol_table() to clients.
ovs-vsctl will, in upcoming commits, want to more closely examine its
ovsdb_symbol_table structures. This could be done by providing a more
complete API, but it doesn't seem worth it to me. This commit instead goes
the other way, exposing the internals to clients. This commit also
eliminates the ovsdb_symbol_table_find_uncreated() function, which
ovs-vsctl can now implement itself.
Diffstat (limited to 'utilities')
-rw-r--r-- | utilities/ovs-vsctl.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c index 2818a38f..e5e03f73 100644 --- a/utilities/ovs-vsctl.c +++ b/utilities/ovs-vsctl.c @@ -3354,8 +3354,8 @@ do_vsctl(const char *args, struct vsctl_command *commands, size_t n_commands, const struct ovsrec_open_vswitch *ovs; enum ovsdb_idl_txn_status status; struct ovsdb_symbol_table *symtab; - const char *uncreated; struct vsctl_command *c; + struct shash_node *node; int64_t next_cfg = 0; char *error = NULL; @@ -3395,10 +3395,13 @@ do_vsctl(const char *args, struct vsctl_command *commands, size_t n_commands, } } - uncreated = ovsdb_symbol_table_find_uncreated(symtab); - if (uncreated) { - vsctl_fatal("row id \"%s\" is referenced but never created (e.g. " - "with \"-- --id=%s create ...\")", uncreated, uncreated); + SHASH_FOR_EACH (node, &symtab->sh) { + struct ovsdb_symbol *symbol = node->data; + if (!symbol->created) { + vsctl_fatal("row id \"%s\" is referenced but never created (e.g. " + "with \"-- --id=%s create ...\")", + node->name, node->name); + } } status = ovsdb_idl_txn_commit_block(txn); |