forked from openvswitch/ovs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ovsdb-server: Add support for a built-in _Server database.
The _Server database is valuable primarily because it provides database clients a way to find out the details of changes to databases, schemas, etc. in a granular, natural way. Until now, the only way that the server could notify clients about these kinds of changes was to close the session; when the client reconnects, it is expected to reassess the server's state. One way to provide this kind of granular information would be to add specific JSON-RPC requests to obtain notifications for different kinds of changes, but since ovsdb-server already provides granular and flexible notification support for databases, using a database for the purpose is convenient and avoids duplicating functionality. Initially this database only reports databases' names and schemas, but when clustering support is added in a later commit it will also report important aspects of clustering and cluster status. Thus, this database also reduces the need to add JSON-RPC calls to retrieve information about new features. Signed-off-by: Ben Pfaff <[email protected]>
- Loading branch information
Showing
18 changed files
with
367 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#! /usr/bin/python | ||
|
||
import re | ||
import sys | ||
|
||
"""This utility reads its input, which should be plain text, and | ||
prints it back transformed into quoted strings that may be #included | ||
into C source code.""" | ||
|
||
while True: | ||
line = sys.stdin.readline() | ||
if not line: | ||
break | ||
|
||
s = line.replace("\\", "\\\\").replace('"', '\\"').replace("\n", "\\n") | ||
print('"' + s + '"') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
ovsdb/ovsdb-server.1 | ||
ovsdb/ovsdb-server.5 | ||
utilities/ovs-ctl.8 | ||
utilities/ovs-dpctl-top.8 | ||
utilities/ovs-dpctl.8 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
/_server.ovsschema.inc | ||
/_server.ovsschema.stamp | ||
/ovsdb-client | ||
/ovsdb-client.1 | ||
/ovsdb-doc | ||
/ovsdb-dot | ||
/ovsdb-idlc | ||
/ovsdb-server | ||
/ovsdb-server.1 | ||
/ovsdb-server.5 | ||
/ovsdb-tool | ||
/ovsdb-tool.1 | ||
/libovsdb.pc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{"name": "_Server", | ||
"version": "1.0.0", | ||
"cksum": "3931859656 185", | ||
"tables": { | ||
"Database": { | ||
"columns": { | ||
"name": {"type": "string"}, | ||
"schema": {"type": "string"}}, | ||
"isRoot": true}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<database name="ovsdb-server" title="ovsdb-server _Server schema"> | ||
<p> | ||
Every <code>ovsdb-server</code> (version 2.9 or later) always hosts an | ||
instance of this schema, which holds information on the status and | ||
configuration of the server itself. This database is read-only. This | ||
manpage describes the schema for this database. | ||
</p> | ||
|
||
<table name="Database" title="Databases."> | ||
<p> | ||
This table describes the databases hosted by the database server, with | ||
one row per database. As its database configuration and status changes, | ||
the server automatically and immediately updates the table to match. | ||
</p> | ||
<p> | ||
Clients can use the <code>_uuid</code> column in this table as a | ||
generation number. The server generates a fresh <code>_uuid</code> every | ||
time it adds a database, so that removing and then re-adding a database | ||
to the server causes its row <code>_uuid</code> to change. | ||
</p> | ||
|
||
<column name="name"> | ||
The database's name, as specified in its schema. | ||
</column> | ||
|
||
<column name="schema"> | ||
The database schema, as a JSON string. | ||
</column> | ||
</table> | ||
</database> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.