summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-10-22 10:19:13 -0700
committerJustin Pettit <jpettit@nicira.com>2010-10-25 23:44:22 -0700
commit7662e18d822869347de6a5273e88fd0d7c1addb2 (patch)
tree66902eb005e6fe20c266970dcfe563070ba4618b
parentc5ef4d5f755873bb6ec9ff4880a1284e6fcd8829 (diff)
downloadopenvswitch-7662e18d822869347de6a5273e88fd0d7c1addb2.tar.gz
vswitch: Make unique "name" columns immutable, to simplify transactions.
OVSDB has transactions but not locking, so a transaction that must maintain an invariant must check that the starting state is what it expects. For example, to add a bridge a client must verify that the new bridge's name does not conflict with any existing bridge's name, given that the set of bridges might have changed. One way to do that is for the client to verify that that the set of bridges is the same and that none of the bridges has been renamed to the new bridge's name. By making bridge names immutable, the latter part of the check can be omitted. Mirror names are not required to be unique so this commit does not make them immutable. CC: Jeremy Stribling <strib@nicira.com>
-rw-r--r--vswitchd/vswitch.ovsschema9
1 files changed, 6 insertions, 3 deletions
diff --git a/vswitchd/vswitch.ovsschema b/vswitchd/vswitch.ovsschema
index c8a4963af..0c2aaf42a 100644
--- a/vswitchd/vswitch.ovsschema
+++ b/vswitchd/vswitch.ovsschema
@@ -36,7 +36,8 @@
"Bridge": {
"columns": {
"name": {
- "type": "string"},
+ "type": "string",
+ "mutable": false},
"datapath_type": {
"type": "string"},
"datapath_id": {
@@ -78,7 +79,8 @@
"Port": {
"columns": {
"name": {
- "type": "string"},
+ "type": "string",
+ "mutable": false},
"interfaces": {
"type": {"key": {"type": "uuid",
"refTable": "Interface"},
@@ -115,7 +117,8 @@
"Interface": {
"columns": {
"name": {
- "type": "string"},
+ "type": "string",
+ "mutable": false},
"type": {
"type": "string"},
"options": {