diff --git a/include/villas/node.h b/include/villas/node.h index d14becc49..b01c39d54 100644 --- a/include/villas/node.h +++ b/include/villas/node.h @@ -60,7 +60,7 @@ */ struct vnode { char *name; /**< A short identifier of the node, only used for configuration and logging */ - int enabled; + bool enabled; enum State state; diff --git a/lib/node.cpp b/lib/node.cpp index e58af8290..31a653933 100644 --- a/lib/node.cpp +++ b/lib/node.cpp @@ -68,7 +68,7 @@ int node_init(struct vnode *n, struct vnode_type *vt) n->name = nullptr; n->_name = nullptr; n->_name_long = nullptr; - n->enabled = 1; + n->enabled = true; n->affinity = -1; /* all cores */ #ifdef __linux__ @@ -125,8 +125,7 @@ int node_prepare(struct vnode *n) int node_parse(struct vnode *n, json_t *json, const char *name) { - struct vnode_type *nt; - int ret; + int ret, enabled = n->enabled; json_error_t err; json_t *json_netem = nullptr; @@ -138,11 +137,13 @@ int node_parse(struct vnode *n, json_t *json, const char *name) ret = json_unpack_ex(json, &err, 0, "{ s: s, s?: s, s?: b }", "type", &type, "uuid", &uuid, - "enabled", &n->enabled + "enabled", &enabled ); if (ret) return ret; + n->enabled = enabled; + #ifdef __linux__ ret = json_unpack_ex(json, &err, 0, "{ s?: { s?: o, s?: i } }", "out",