-/* Copyright (c) 2009 Nicira Networks
+/* Copyright (c) 2009, 2010 Nicira Networks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
static ovsdb_operation_executor ovsdb_execute_commit;
static ovsdb_operation_executor ovsdb_execute_abort;
static ovsdb_operation_executor ovsdb_execute_declare;
+static ovsdb_operation_executor ovsdb_execute_comment;
static ovsdb_operation_executor *
lookup_executor(const char *name)
{ "commit", ovsdb_execute_commit },
{ "abort", ovsdb_execute_abort },
{ "declare", ovsdb_execute_declare },
+ { "comment", ovsdb_execute_comment },
};
size_t i;
&& timeout_msec) {
ovsdb_txn_abort(x.txn);
*timeout_msec = x.timeout_msec;
- ovsdb_error_destroy(error);
+
+ json_destroy(result);
json_destroy(results);
- return NULL;
+ results = NULL;
+ goto exit;
}
/* Add result to array. */
json_array_add(results, json_null_create());
}
+exit:
ovsdb_error_destroy(error);
ovsdb_symbol_table_destroy(x.symtab);
xasprintf(UUID_FMT, UUID_ARGS(&uuid))));
return NULL;
}
+
+static struct ovsdb_error *
+ovsdb_execute_comment(struct ovsdb_execution *x, struct ovsdb_parser *parser,
+ struct json *result UNUSED)
+{
+ const struct json *comment;
+
+ comment = ovsdb_parser_member(parser, "comment", OP_STRING);
+ if (!comment) {
+ return NULL;
+ }
+ ovsdb_txn_add_comment(x->txn, json_string(comment));
+
+ return NULL;
+}