2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

ovsdb-data: Add support for integer ranges in database commands

Adding / removing a range of integers to a column accepting a set of
integers requires enumarating all of the integers. This patch simplifies
it by introducing 'range' concept to the database commands. Two integers
separated by a hyphen represent an inclusive range.

The patch adds positive and negative tests for the new syntax.
The patch was tested by 'make check'. Covarage was tested by
'make check-lcov'.

Signed-off-by: Lukasz Rzasik <lukasz.rzasik@gmail.com>
Suggested-by: <my_ovs_discuss@yahoo.com>
Suggested-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
Lukasz Rzasik
2016-12-29 15:55:46 -07:00
committed by Ben Pfaff
parent 84d0ca5d00
commit 1ab39058cc
11 changed files with 284 additions and 67 deletions

View File

@@ -677,7 +677,7 @@ is_condition_satisfied(const struct ctl_table_class *table,
column->name);
}
die_if_error(ovsdb_atom_from_string(&want_key, &column->type.key,
die_if_error(ovsdb_atom_from_string(&want_key, NULL, &column->type.key,
key_string, symtab));
type.key = type.value;
@@ -823,7 +823,7 @@ cmd_get(struct ctl_context *ctx)
column->name);
}
die_if_error(ovsdb_atom_from_string(&key,
die_if_error(ovsdb_atom_from_string(&key, NULL,
&column->type.key,
key_string, ctx->symtab));
@@ -1118,13 +1118,13 @@ set_column(const struct ctl_table_class *table,
column->name);
}
die_if_error(ovsdb_atom_from_string(&key, &column->type.key,
die_if_error(ovsdb_atom_from_string(&key, NULL, &column->type.key,
key_string, symtab));
die_if_error(ovsdb_atom_from_string(&value, &column->type.value,
die_if_error(ovsdb_atom_from_string(&value, NULL, &column->type.value,
value_string, symtab));
ovsdb_datum_init_empty(&datum);
ovsdb_datum_add_unsafe(&datum, &key, &value, &column->type);
ovsdb_datum_add_unsafe(&datum, &key, &value, &column->type, NULL);
ovsdb_atom_destroy(&key, column->type.key.type);
ovsdb_atom_destroy(&value, column->type.value.type);