git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ofproto-dpif: Use sequence number to wake up main thread for
[sliver-openvswitch.git]
/
ovsdb
/
ovsdb-idlc.in
diff --git
a/ovsdb/ovsdb-idlc.in
b/ovsdb/ovsdb-idlc.in
index
6d49dd6
..
6c8aa43
100755
(executable)
--- a/
ovsdb/ovsdb-idlc.in
+++ b/
ovsdb/ovsdb-idlc.in
@@
-110,6
+110,7
@@
def printCIDLHeader(schemaFile):
print "\nextern struct ovsdb_idl_column %s_columns[%s_N_COLUMNS];" % (structName, structName.upper())
print '''
print "\nextern struct ovsdb_idl_column %s_columns[%s_N_COLUMNS];" % (structName, structName.upper())
print '''
+const struct %(s)s *%(s)s_get_for_uuid(const struct ovsdb_idl *, const struct uuid *);
const struct %(s)s *%(s)s_first(const struct ovsdb_idl *);
const struct %(s)s *%(s)s_next(const struct %(s)s *);
#define %(S)s_FOR_EACH(ROW, IDL) \\
const struct %(s)s *%(s)s_first(const struct ovsdb_idl *);
const struct %(s)s *%(s)s_next(const struct %(s)s *);
#define %(S)s_FOR_EACH(ROW, IDL) \\
@@
-166,6
+167,8
@@
struct %(s)s *%(s)s_insert(struct ovsdb_idl_txn *);
print "\nextern struct ovsdb_idl_class %sidl_class;" % prefix
print "\nvoid %sinit(void);" % prefix
print "\nextern struct ovsdb_idl_class %sidl_class;" % prefix
print "\nvoid %sinit(void);" % prefix
+
+ print "\nconst char * %sget_db_version(void);" % prefix
print "\n#endif /* %(prefix)sIDL_HEADER */" % {'prefix': prefix.upper()}
def printEnum(members):
print "\n#endif /* %(prefix)sIDL_HEADER */" % {'prefix': prefix.upper()}
def printEnum(members):
@@
-187,6
+190,7
@@
def printCIDLSource(schemaFile):
#include <config.h>
#include %s
#include <limits.h>
#include <config.h>
#include %s
#include <limits.h>
+#include "ovs-thread.h"
#include "ovsdb-data.h"
#include "ovsdb-error.h"
#include "util.h"
#include "ovsdb-data.h"
#include "ovsdb-error.h"
#include "util.h"
@@
-378,6
+382,12
@@
void
# First, next functions.
print '''
# First, next functions.
print '''
+const struct %(s)s *
+%(s)s_get_for_uuid(const struct ovsdb_idl *idl, const struct uuid *uuid)
+{
+ return %(s)s_cast(ovsdb_idl_get_row_for_uuid(idl, &%(p)stable_classes[%(P)sTABLE_%(T)s], uuid));
+}
+
const struct %(s)s *
%(s)s_first(const struct ovsdb_idl *idl)
{
const struct %(s)s *
%(s)s_first(const struct ovsdb_idl *idl)
{
@@
-643,6
+653,7
@@
void
if (inited) {
return;
}
if (inited) {
return;
}
+ assert_single_threaded();
inited = true;
""" % prefix
for tableName, table in sorted(schema.tables.iteritems()):
inited = true;
""" % prefix
for tableName, table in sorted(schema.tables.iteritems()):
@@
-650,6
+661,16
@@
void
print " %s_columns_init();" % structName
print "}"
print " %s_columns_init();" % structName
print "}"
+ print """
+/* Return the schema version. The caller must not free the returned value. */
+const char *
+%sget_db_version(void)
+{
+ return "%s";
+}
+""" % (prefix, schema.version)
+
+
def ovsdb_escape(string):
def escape(match):
def ovsdb_escape(string):
def escape(match):