static const struct ovsdb_idl_row *
get_row_by_id(struct vsctl_context *ctx, const struct vsctl_table_class *table,
- const struct vsctl_row_id *id, const char *record_id)
+ const struct vsctl_row_id *id, const char *record_id,
+ bool partial_match_ok)
{
const struct ovsdb_idl_row *referrer, *final;
ovsdb_idl_txn_read(row, id->name_column, &name);
if (name.n == 1) {
- unsigned int score = score_partial_match(name.keys[0].string,
- record_id);
+ unsigned int score;
+
+ score = (partial_match_ok
+ ? score_partial_match(name.keys[0].string, record_id)
+ : !strcmp(name.keys[0].string, record_id));
if (score > best_score) {
referrer = row;
best_score = score;
}
static const struct ovsdb_idl_row *
-get_row(struct vsctl_context *ctx,
- const struct vsctl_table_class *table, const char *record_id)
+get_row__(struct vsctl_context *ctx,
+ const struct vsctl_table_class *table, const char *record_id,
+ bool partial_match_ok)
{
const struct ovsdb_idl_row *row;
struct uuid uuid;
int i;
for (i = 0; i < ARRAY_SIZE(table->row_ids); i++) {
- row = get_row_by_id(ctx, table, &table->row_ids[i], record_id);
+ row = get_row_by_id(ctx, table, &table->row_ids[i], record_id,
+ partial_match_ok);
if (row) {
break;
}
return row;
}
+static const struct ovsdb_idl_row *
+get_row(struct vsctl_context *ctx,
+ const struct vsctl_table_class *table, const char *record_id)
+{
+ return get_row__(ctx, table, record_id, true);
+}
+
static const struct ovsdb_idl_row *
must_get_row(struct vsctl_context *ctx,
const struct vsctl_table_class *table, const char *record_id)