Skip to contentSkip to conversation

Fix: relayd protocol version

PATCH Mathieu Desnoyers 1 participant 1 message Aug 5, 2013 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Mathieu Desnoyers

author Acked-by Julien Desfossez Acked-by Julien Desfossez Acked-by Julien Desfossez
#1 lore raw
Quoted 2 lines · * Julien Desfossez ([email protected]) wrote:

Since we heritate the relayd protocol version from the sessiond and relayd version, use the VERSION macro instead of additionnal fields.

I merged these instead:

commit d83a952ce0d3a03bd3d36505d665db99b2c65fa2

Author: Mathieu Desnoyers <[email protected]>
Date:   Mon Aug 5 15:26:41 2013 -0400

relayd: use version macros from build rather than scanf

commit 6947778efd60badf06cec2bd5c39d7f96f5ba7ad

Author: Mathieu Desnoyers <[email protected]>
Date:   Mon Aug 5 15:24:31 2013 -0400

sessiond: use version major/minor from build for communication with relayd

commit 81265501f5370482b1ee9c24d3fa6537c5ca0389

Author: Mathieu Desnoyers <[email protected]>
Date:   Mon Aug 5 15:23:27 2013 -0400

build: export major/minor/patchlevel numbers

Quoted 47 lines
---
 src/bin/lttng-sessiond/cmd.c      |   11 +++++++++--
 src/common/sessiond-comm/relayd.h |    3 ---
 2 files changed, 9 insertions(+), 5 deletions(-)
src/bin/lttng-sessiond/cmd.c +9 -2
index 84594ad..07366af 100644
@@ -491,9 +491,16 @@ static int create_connect_relayd(struct lttng_uri *uri,
 {
 	int ret;
 	struct lttcomm_relayd_sock *rsock;
+	uint32_t major, minor;
 
-	rsock = lttcomm_alloc_relayd_sock(uri, RELAYD_VERSION_COMM_MAJOR,
-			RELAYD_VERSION_COMM_MINOR);
+	ret = sscanf(VERSION, "%10u.%10u", &major, &minor);
+	if (ret < 2) {
+		ERR("Error in scanning version");
+		ret = -1;
+		goto error;
+	}
+
+	rsock = lttcomm_alloc_relayd_sock(uri, major, minor);
 	if (!rsock) {
 		ret = LTTNG_ERR_FATAL;
 		goto error;
src/common/sessiond-comm/relayd.h +0 -3
index aa99248..836327c 100644
@@ -27,9 +27,6 @@
 #include <lttng/lttng.h>
 #include <common/defaults.h>
 
-#define RELAYD_VERSION_COMM_MAJOR             2
-#define RELAYD_VERSION_COMM_MINOR             2
-
 /*
  * lttng-relayd communication header.
  */
Signature · 1 line
1.7.10.4
Signature · 3 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com