[ovs-dev] [ovn v2 4/6] ovn-controller: Rename "chassis_name" to "chassis_id".
Justin Pettit
jpettit at nicira.com
Thu Apr 30 06:54:38 UTC 2015
This makes it more consistent with other IDs in the system.
Signed-off-by: Justin Pettit <jpettit at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>
---
ovn/controller/bindings.c | 14 +++++++-------
ovn/controller/chassis.c | 10 +++++-----
ovn/controller/ovn-controller.c | 4 ++--
ovn/controller/ovn-controller.h | 2 +-
4 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/ovn/controller/bindings.c b/ovn/controller/bindings.c
index dc1da5a..ef233c0 100644
--- a/ovn/controller/bindings.c
+++ b/ovn/controller/bindings.c
@@ -86,20 +86,20 @@ bindings_run(struct controller_ctx *ctx)
txn = ovsdb_idl_txn_create(ctx->ovnsb_idl);
ovsdb_idl_txn_add_comment(txn,
"ovn-controller: updating bindings for '%s'",
- ctx->chassis_name);
+ ctx->chassis_id);
SBREC_BINDINGS_FOR_EACH(bindings_rec, ctx->ovnsb_idl) {
if (sset_find_and_delete(&lports, bindings_rec->logical_port)) {
- if (!strcmp(bindings_rec->chassis, ctx->chassis_name)) {
+ if (!strcmp(bindings_rec->chassis, ctx->chassis_id)) {
continue;
}
if (bindings_rec->chassis[0]) {
VLOG_INFO("Changing chassis for lport %s from %s to %s",
bindings_rec->logical_port, bindings_rec->chassis,
- ctx->chassis_name);
+ ctx->chassis_id);
}
- sbrec_bindings_set_chassis(bindings_rec, ctx->chassis_name);
- } else if (!strcmp(bindings_rec->chassis, ctx->chassis_name)) {
+ sbrec_bindings_set_chassis(bindings_rec, ctx->chassis_id);
+ } else if (!strcmp(bindings_rec->chassis, ctx->chassis_id)) {
sbrec_bindings_set_chassis(bindings_rec, "");
}
}
@@ -132,10 +132,10 @@ bindings_destroy(struct controller_ctx *ctx)
txn = ovsdb_idl_txn_create(ctx->ovnsb_idl);
ovsdb_idl_txn_add_comment(txn,
"ovn-controller: removing all bindings for '%s'",
- ctx->chassis_name);
+ ctx->chassis_id);
SBREC_BINDINGS_FOR_EACH(bindings_rec, ctx->ovnsb_idl) {
- if (!strcmp(bindings_rec->chassis, ctx->chassis_name)) {
+ if (!strcmp(bindings_rec->chassis, ctx->chassis_id)) {
sbrec_bindings_set_chassis(bindings_rec, "");
}
}
diff --git a/ovn/controller/chassis.c b/ovn/controller/chassis.c
index 768b812..37287c1 100644
--- a/ovn/controller/chassis.c
+++ b/ovn/controller/chassis.c
@@ -44,11 +44,11 @@ register_chassis(struct controller_ctx *ctx,
txn = ovsdb_idl_txn_create(ctx->ovnsb_idl);
ovsdb_idl_txn_add_comment(txn,
"ovn-controller: registering chassis '%s'",
- ctx->chassis_name);
+ ctx->chassis_id);
if (!chassis_rec) {
chassis_rec = sbrec_chassis_insert(txn);
- sbrec_chassis_set_name(chassis_rec, ctx->chassis_name);
+ sbrec_chassis_set_name(chassis_rec, ctx->chassis_id);
}
encap_rec = sbrec_encap_insert(txn);
@@ -76,7 +76,7 @@ chassis_run(struct controller_ctx *ctx)
static bool inited = false;
SBREC_CHASSIS_FOR_EACH(chassis_rec, ctx->ovnsb_idl) {
- if (!strcmp(chassis_rec->name, ctx->chassis_name)) {
+ if (!strcmp(chassis_rec->name, ctx->chassis_id)) {
break;
}
}
@@ -132,7 +132,7 @@ chassis_destroy(struct controller_ctx *ctx)
struct ovsdb_idl_txn *txn;
SBREC_CHASSIS_FOR_EACH(chassis_rec, ctx->ovnsb_idl) {
- if (!strcmp(chassis_rec->name, ctx->chassis_name)) {
+ if (!strcmp(chassis_rec->name, ctx->chassis_id)) {
break;
}
}
@@ -144,7 +144,7 @@ chassis_destroy(struct controller_ctx *ctx)
txn = ovsdb_idl_txn_create(ctx->ovnsb_idl);
ovsdb_idl_txn_add_comment(txn,
"ovn-controller: unregistering chassis '%s'",
- ctx->chassis_name);
+ ctx->chassis_id);
sbrec_chassis_delete(chassis_rec);
retval = ovsdb_idl_txn_commit_block(txn);
diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c
index 60ae35a..477ad0a 100644
--- a/ovn/controller/ovn-controller.c
+++ b/ovn/controller/ovn-controller.c
@@ -131,7 +131,7 @@ get_core_config(struct controller_ctx *ctx)
}
ovnsb_remote = xstrdup(remote);
- ctx->chassis_name = xstrdup(system_id);
+ ctx->chassis_id = xstrdup(system_id);
return;
try_again:
@@ -145,7 +145,7 @@ int
main(int argc, char *argv[])
{
struct unixctl_server *unixctl;
- struct controller_ctx ctx = { .chassis_name = NULL };
+ struct controller_ctx ctx = { .chassis_id = NULL };
bool exiting;
int retval;
diff --git a/ovn/controller/ovn-controller.h b/ovn/controller/ovn-controller.h
index e22c265..9d2fb39 100644
--- a/ovn/controller/ovn-controller.h
+++ b/ovn/controller/ovn-controller.h
@@ -18,7 +18,7 @@
#define OVN_CONTROLLER_H 1
struct controller_ctx {
- char *chassis_name; /* Name for this chassis. */
+ char *chassis_id; /* ID for this chassis. */
const char *br_int_name; /* Name of local integration bridge. */
struct ovsdb_idl *ovnsb_idl;
struct ovsdb_idl *ovs_idl;
--
1.7.5.4
More information about the dev
mailing list