Fix relayd version check and remove unused code
authorDavid Goulet <dgoulet@efficios.com>
Fri, 17 Aug 2012 19:03:39 +0000 (15:03 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 17 Aug 2012 19:04:34 +0000 (15:04 -0400)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-relayd/main.c
src/bin/lttng-sessiond/main.c
src/common/relayd/relayd.c
src/common/sessiond-comm/relayd.h

index 77e314d95771757bd97e14765247752d08242f9b..cb115afda0ede578de51c9302b5380f4bd2bf671 100644 (file)
@@ -1248,7 +1248,8 @@ int relay_send_version(struct lttcomm_relayd_hdr *recv_hdr,
        if (ret < 0) {
                ERR("Relay sending version");
        }
-       DBG("Version check done");
+       DBG("Version check done (%u.%u)", be32toh(reply.major),
+                       be32toh(reply.minor));
 
 end:
        return ret;
index 8cd9d4c57ee62ecc58e6bf70a48da4d26e47cbe5..c952fc0a90851361ff47f5e0c97f3d81a6a7d04b 100644 (file)
@@ -2001,7 +2001,8 @@ static int create_connect_relayd(struct consumer_output *output,
                DBG3("Creating relayd stream socket from URI");
 
                /* Check relayd version */
-               ret = relayd_version_check(sock, LTTNG_UST_COMM_MAJOR, 0);
+               ret = relayd_version_check(sock, RELAYD_VERSION_COMM_MAJOR,
+                               RELAYD_VERSION_COMM_MINOR);
                if (ret < 0) {
                        ret = LTTCOMM_RELAYD_VERSION_FAIL;
                        goto close_sock;
index 7e99dbb674c1c304836fe72727a8fa07e2ee0a61..f79555fa8c1330e988efd0645d57a31839402306 100644 (file)
@@ -97,58 +97,6 @@ error:
        return ret;
 }
 
-#if 0
-/*
- * Create session on the relayd.
- *
- * On error, return ret_code negative value else return 0.
- */
-int relayd_create_session(struct lttcomm_sock *sock, const char *hostname,
-               const char *session_name)
-{
-       int ret;
-       struct lttcomm_relayd_create_session msg;
-       struct lttcomm_relayd_generic_reply reply;
-
-       /* Code flow error. Safety net. */
-       assert(sock);
-       assert(hostname);
-       assert(session_name);
-
-       DBG("Relayd creating session for hostname %s and session name %s",
-                       hostname, session_name);
-
-       strncpy(msg.hostname, hostname, sizeof(msg.hostname));
-       strncpy(msg.session_name, session_name, sizeof(msg.session_name));
-
-       /* Send command */
-       ret = send_command(sock, RELAYD_CREATE_SESSION, (void *) &msg,
-                       sizeof(msg), 0);
-       if (ret < 0) {
-               goto error;
-       }
-
-       /* Recevie response */
-       ret = recv_reply(sock, (void *) &reply, sizeof(reply));
-       if (ret < 0) {
-               goto error;
-       }
-
-       /* Return session id or negative ret code. */
-       if (reply.ret_code != LTTCOMM_OK) {
-               ret = -reply.ret_code;
-       } else {
-               /* Success */
-               ret = 0;
-       }
-
-       DBG2("Relayd created session for %s", session_name);
-
-error:
-       return ret;
-}
-#endif
-
 /*
  * Add stream on the relayd and assign stream handle to the stream_id argument.
  *
@@ -255,47 +203,6 @@ error:
        return ret;
 }
 
-#if 0
-/*
- * Start data command on the relayd.
- *
- * On success return 0 else return ret_code negative value.
- */
-int relayd_start_data(struct lttcomm_sock *sock)
-{
-       int ret;
-       struct lttcomm_relayd_generic_reply reply;
-
-       /* Code flow error. Safety net. */
-       assert(sock);
-
-       DBG("Relayd start data command");
-
-       /* Send command */
-       ret = send_command(sock, RELAYD_START_DATA, NULL, 0, 0);
-       if (ret < 0) {
-               goto error;
-       }
-
-       /* Recevie response */
-       ret = recv_reply(sock, (void *) &reply, sizeof(reply));
-       if (ret < 0) {
-               goto error;
-       }
-
-       /* Return session id or negative ret code. */
-       if (reply.ret_code != LTTCOMM_OK) {
-               ret = -reply.ret_code;
-       } else {
-               /* Success */
-               ret = 0;
-       }
-
-error:
-       return ret;
-}
-#endif
-
 /*
  * Add stream on the relayd and assign stream handle to the stream_id argument.
  *
index c025fcdd926a21eef1032a72c4f5cd9a8461e99a..24b7c912fa679a21e4b234e11ac2764780e66ac6 100644 (file)
@@ -26,6 +26,9 @@
 
 #include <lttng/lttng.h>
 
+#define RELAYD_VERSION_COMM_MAJOR             2
+#define RELAYD_VERSION_COMM_MINOR             1
+
 /*
  * lttng-relayd communication header.
  */
This page took 0.031715 seconds and 4 git commands to generate.