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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user