summaryrefslogtreecommitdiff
path: root/ovn
diff options
context:
space:
mode:
authorDaniel Alvarez Sanchez <dalvarez@redhat.com>2017-06-06 10:08:03 +0000
committerRussell Bryant <russell@ovn.org>2017-06-07 14:57:51 -0400
commit37737b96e4686ab83e8d582afbaf58eb2b847332 (patch)
treea65cd2e8271e1e42b1ea2f17b9d44ff41fa7e3d6 /ovn
parenta8cb558a5c03a26859bc9c33ec5b1112033398f4 (diff)
downloadopenvswitch-37737b96e4686ab83e8d582afbaf58eb2b847332.tar.gz
Copy external_ids from Logical_Switch_Port to SB database
This patch makes ovn-northd copy all string-string pairs in external_ids column of the Logical_Switch_Port table in Northbound database to the equivalent column of the Port_Binding table in Southbound database. OpenStack Neutron will add some useful data to NB database that can be later read by networking-ovn-metadata-agent without the need of maintaining a connection to NB database. This data would include the CIDR's of a port or the project and device ID's which are needed when talking to Nova to request metadata. Signed-off-by: Daniel Alvarez <dalvarez@redhat.com> Signed-off-by: Russell Bryant <russell@ovn.org>
Diffstat (limited to 'ovn')
-rw-r--r--ovn/northd/ovn-northd.c5
-rw-r--r--ovn/ovn-nb.xml11
-rw-r--r--ovn/ovn-sb.xml11
3 files changed, 23 insertions, 4 deletions
diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c
index 591498816..4466f22a4 100644
--- a/ovn/northd/ovn-northd.c
+++ b/ovn/northd/ovn-northd.c
@@ -1814,12 +1814,13 @@ ovn_port_update_sbrec(const struct ovn_port *op,
op->nbsp->n_addresses);
struct smap ids = SMAP_INITIALIZER(&ids);
- const char *name = smap_get(&op->nbsp->external_ids,
- "neutron:port_name");
+ smap_clone(&ids, &op->nbsp->external_ids);
+ const char *name = smap_get(&ids, "neutron:port_name");
if (name && name[0]) {
smap_add(&ids, "name", name);
}
sbrec_port_binding_set_external_ids(op->sb, &ids);
+ smap_destroy(&ids);
}
}
diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml
index f9e5bfd31..32c10c147 100644
--- a/ovn/ovn-nb.xml
+++ b/ovn/ovn-nb.xml
@@ -848,7 +848,16 @@
<group title="Common Columns">
<column name="external_ids">
- See <em>External IDs</em> at the beginning of this document.
+ <p>
+ See <em>External IDs</em> at the beginning of this document.
+ </p>
+
+ <p>
+ The <code>ovn-northd</code> program copies all these pairs into the
+ <ref column="external_ids"/> column of the
+ <ref table="Port_Binding"/> table in <ref db="OVN_Southbound"/>
+ database.
+ </p>
</column>
</group>
</table>
diff --git a/ovn/ovn-sb.xml b/ovn/ovn-sb.xml
index c295b9087..9070378eb 100644
--- a/ovn/ovn-sb.xml
+++ b/ovn/ovn-sb.xml
@@ -2179,7 +2179,16 @@ tcp.flags = RST;
<group title="Common Columns">
<column name="external_ids">
- See <em>External IDs</em> at the beginning of this document.
+ <p>
+ See <em>External IDs</em> at the beginning of this document.
+ </p>
+
+ <p>
+ The <code>ovn-northd</code> program populates this column with
+ all entries into the <ref column="external_ids"/> column of the
+ <ref table="Logical_Switch_Port"/> table of the
+ <ref db="OVN_Northbound"/> database.
+ </p>
</column>
</group>
</table>