ovsdb: Correct specification inconsistency between "lock" and "assert".
authorBen Pfaff <blp@nicira.com>
Fri, 5 Aug 2011 22:56:05 +0000 (15:56 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 8 Aug 2011 17:23:27 +0000 (10:23 -0700)
The "lock" request requires the lock name to be an <id> but it is shown as
<string> in the "assert" operation.  This corrects the "assert"
specification and fixes the suggested naming convention (since ":" is not
valid in an <id>).

This commit also updates the implementation to match the specification.

Reported-by: Jeremy Stribling <strib@nicira.com>
ovsdb/SPECS
ovsdb/execution.c

index e2898c2..5bdb974 100644 (file)
@@ -682,7 +682,7 @@ The "locked" and "stolen" notifications (see below) report
 asynchronous changes to ownership.
 
 The scope of a lock is a database server, not a database hosted by
-that server.  A naming convention, such as "<db-name>:<lock-name>",
+that server.  A naming convention, such as "<db-name>__<lock-name>",
 can effectively limit the scope of a lock to a particular database.
 
 locked
@@ -1300,7 +1300,7 @@ assert
 Request object members:
 
     "op": "assert"                     required
-    "lock": <string>                   required
+    "lock": <id>                       required
 
 Result object members:
 
index 9e3a8d0..675c1c3 100644 (file)
@@ -719,7 +719,7 @@ ovsdb_execute_assert(struct ovsdb_execution *x, struct ovsdb_parser *parser,
 {
     const struct json *lock_name;
 
-    lock_name = ovsdb_parser_member(parser, "lock", OP_STRING);
+    lock_name = ovsdb_parser_member(parser, "lock", OP_ID);
     if (!lock_name) {
         return NULL;
     }