aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-04-13 11:10:44 -0700
committerBen Pfaff <blp@nicira.com>2011-04-29 14:32:00 -0700
commit7174e5aed2a6d2877c1760d2ae921ae24d7accb5 (patch)
treed5459de518c950a230a83720e43dbfa21097d562 /lib
parentca09af69b3aa81ce257d89a36375ba163c9d09ba (diff)
bridge: Tolerate missing Port and Interface records for local port.
Until now, ovs-vswitchd has been unable to configure IP addresses and routes for bridges whose Bridge records lack a Port and an Interface record for the bridge's local port (e.g. OFPP_LOCAL, the port with the same name as the bridge itself). When such a bridge was reconfigured, ovs-vswitchd would output a log message that worried people. This commit fixes the internal limitation that led to the message being printed. Bug #5385.
Diffstat (limited to 'lib')
-rw-r--r--lib/ovsdb-idl.c9
-rw-r--r--lib/ovsdb-idl.h4
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index e1b53f4e..fd15ea96 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -1108,6 +1108,15 @@ ovsdb_idl_get(const struct ovsdb_idl_row *row,
return ovsdb_idl_read(row, column);
}
+
+/* Returns false if 'row' was obtained from the IDL, true if it was initialized
+ * to all-zero-bits by some other entity. If 'row' was set up some other way
+ * then the return value is indeterminate. */
+bool
+ovsdb_idl_row_is_synthetic(const struct ovsdb_idl_row *row)
+{
+ return row->table == NULL;
+}
/* Transactions. */
diff --git a/lib/ovsdb-idl.h b/lib/ovsdb-idl.h
index 302abd6a..d11fb0e0 100644
--- a/lib/ovsdb-idl.h
+++ b/lib/ovsdb-idl.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010 Nicira Networks.
+/* Copyright (c) 2009, 2010, 2011 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -105,6 +105,8 @@ const struct ovsdb_datum *ovsdb_idl_get(const struct ovsdb_idl_row *,
const struct ovsdb_idl_column *,
enum ovsdb_atomic_type key_type,
enum ovsdb_atomic_type value_type);
+
+bool ovsdb_idl_row_is_synthetic(const struct ovsdb_idl_row *);
/* Transactions. */