return;
}
- const struct sbrec_chassis *chassis_rec;
const struct ovsrec_open_vswitch *cfg;
const char *encap_type, *encap_ip;
static bool inited = false;
- chassis_rec = get_chassis(ctx->ovnsb_idl, chassis_id);
-
cfg = ovsrec_open_vswitch_first(ctx->ovs_idl);
if (!cfg) {
VLOG_INFO("No Open_vSwitch row defined.");
}
free(tokstr);
- char hostname[HOST_NAME_MAX + 1];
- if (gethostname(hostname, sizeof hostname)) {
- hostname[0] = '\0';
+ const char *hostname = smap_get(&cfg->external_ids, "hostname");
+ char hostname_[HOST_NAME_MAX + 1];
+ if (!hostname || !hostname[0]) {
+ if (gethostname(hostname_, sizeof hostname_)) {
+ hostname_[0] = '\0';
+ }
+ hostname = hostname_;
}
+ const struct sbrec_chassis *chassis_rec
+ = get_chassis(ctx->ovnsb_idl, chassis_id);
+
if (chassis_rec) {
if (strcmp(hostname, chassis_rec->hostname)) {
sbrec_chassis_set_hostname(chassis_rec, hostname);
<dt><code>external_ids:system-id</code></dt>
<dd>The chassis name to use in the Chassis table.</dd>
+ <dt><code>external_ids:hostname</code></dt>
+ <dd>The hostname to use in the Chassis table.</dd>
+
<dt><code>external_ids:ovn-bridge</code></dt>
<dd>
The integration bridge to which logical ports are attached. The