*/
#include <config.h>
+#include <unistd.h>
+
#include "chassis.h"
#include "lib/vswitch-idl.h"
}
free(tokstr);
+ char hostname[HOST_NAME_MAX + 1];
+ if (gethostname(hostname, sizeof hostname)) {
+ hostname[0] = '\0';
+ }
+
if (chassis_rec) {
+ if (strcmp(hostname, chassis_rec->hostname)) {
+ sbrec_chassis_set_hostname(chassis_rec, hostname);
+ }
+
/* Compare desired tunnels against those currently in the database. */
uint32_t cur_tunnels = 0;
bool same = true;
if (!chassis_rec) {
chassis_rec = sbrec_chassis_insert(ctx->ovnsb_idl_txn);
sbrec_chassis_set_name(chassis_rec, chassis_id);
+ sbrec_chassis_set_hostname(chassis_rec, hostname);
}
int n_encaps = count_1bits(req_tunnels);
{
"name": "OVN_Southbound",
- "version": "1.1.0",
- "cksum": "1223981720 5320",
+ "version": "1.2.0",
+ "cksum": "1259182303 5368",
"tables": {
"Chassis": {
"columns": {
"name": {"type": "string"},
+ "hostname": {"type": "string"},
"encaps": {"type": {"key": {"type": "uuid",
"refTable": "Encap"},
"min": 1, "max": "unlimited"}},
not prescribe a particular format for chassis names.
</column>
+ <column name="hostname">
+ The hostname of the chassis, if applicable. ovn-controller will populate
+ this column with the hostname of the host it is running on.
+ ovn-controller-vtep will leave this column empty.
+ </column>
+
<group title="Encapsulation Configuration">
<p>
OVN uses encapsulation to transmit logical dataplane packets
static struct cmd_show_table cmd_show_tables[] = {
{&sbrec_table_chassis,
&sbrec_chassis_col_name,
- {&sbrec_chassis_col_encaps,
- NULL,
+ {&sbrec_chassis_col_hostname,
+ &sbrec_chassis_col_encaps,
NULL},
{&sbrec_table_port_binding,
&sbrec_port_binding_col_logical_port,