diff options
author | Ben Pfaff <blp@nicira.com> | 2010-03-05 17:05:43 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2010-03-05 17:05:43 -0800 |
commit | 2e57b537305cbaa6f724a28957510a6d86aa2d0f (patch) | |
tree | 95122be4e117996e9802cb8f254467c2a4eb4887 /ovsdb/column.c | |
parent | 8936565369410daa099708be4cd3fa7e0e39bade (diff) | |
download | openvswitch-2e57b537305cbaa6f724a28957510a6d86aa2d0f.tar.gz |
ovsdb: Remove "comment" support from OVSDB schemas.
Using a separate XML file to document a schema is much more flexible.
You end up with two files (a schema and documentation for it), each of
which is readable and maintainable, instead of a single schema file that
is almost illegible.
Diffstat (limited to 'ovsdb/column.c')
-rw-r--r-- | ovsdb/column.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/ovsdb/column.c b/ovsdb/column.c index 58fff1084..a22e1a237 100644 --- a/ovsdb/column.c +++ b/ovsdb/column.c @@ -27,7 +27,7 @@ #include "util.h" struct ovsdb_column * -ovsdb_column_create(const char *name, const char *comment, +ovsdb_column_create(const char *name, bool mutable, bool persistent, const struct ovsdb_type *type) { @@ -36,7 +36,6 @@ ovsdb_column_create(const char *name, const char *comment, column = xzalloc(sizeof *column); column->name = xstrdup(name); - column->comment = comment ? xstrdup(comment) : NULL; column->mutable = mutable; column->persistent = persistent; ovsdb_type_clone(&column->type, type); @@ -48,7 +47,7 @@ struct ovsdb_column * ovsdb_column_clone(const struct ovsdb_column *old) { /* Doesn't copy the column's 'index': the caller must do that. */ - return ovsdb_column_create(old->name, old->comment, + return ovsdb_column_create(old->name, old->mutable, old->persistent, &old->type); } @@ -58,7 +57,6 @@ ovsdb_column_destroy(struct ovsdb_column *column) { ovsdb_type_destroy(&column->type); free(column->name); - free(column->comment); free(column); } @@ -66,7 +64,7 @@ struct ovsdb_error * ovsdb_column_from_json(const struct json *json, const char *name, struct ovsdb_column **columnp) { - const struct json *comment, *mutable, *ephemeral, *type_json; + const struct json *mutable, *ephemeral, *type_json; struct ovsdb_error *error; struct ovsdb_type type; struct ovsdb_parser parser; @@ -75,7 +73,6 @@ ovsdb_column_from_json(const struct json *json, const char *name, *columnp = NULL; ovsdb_parser_init(&parser, json, "schema for column %s", name); - comment = ovsdb_parser_member(&parser, "comment", OP_STRING | OP_OPTIONAL); mutable = ovsdb_parser_member(&parser, "mutable", OP_TRUE | OP_FALSE | OP_OPTIONAL); ephemeral = ovsdb_parser_member(&parser, "ephemeral", @@ -93,7 +90,6 @@ ovsdb_column_from_json(const struct json *json, const char *name, persistent = ephemeral ? !json_boolean(ephemeral) : true; *columnp = ovsdb_column_create(name, - comment ? json_string(comment) : NULL, mutable ? json_boolean(mutable) : true, persistent, &type); @@ -106,9 +102,6 @@ struct json * ovsdb_column_to_json(const struct ovsdb_column *column) { struct json *json = json_object_create(); - if (column->comment) { - json_object_put_string(json, "comment", column->comment); - } if (!column->mutable) { json_object_put(json, "mutable", json_boolean_create(false)); } |