X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fconsumer.c;h=f0870e6b0c0abcf2ae50e83c32df5ef2b162a33e;hp=befc5d6dcf95c2dd441412e132a5f2c58158acf4;hb=d3e2ba59faddb31870e2ce29b6a881f7ad5ad883;hpb=7ce3675685dbbc7be9536eb9c2b5ff8d677dc0b5 diff --git a/src/bin/lttng-sessiond/consumer.c b/src/bin/lttng-sessiond/consumer.c index befc5d6dc..f0870e6b0 100644 --- a/src/bin/lttng-sessiond/consumer.c +++ b/src/bin/lttng-sessiond/consumer.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "consumer.h" #include "health.h" @@ -939,7 +940,8 @@ error: */ int consumer_send_relayd_socket(struct consumer_socket *consumer_sock, struct lttcomm_relayd_sock *rsock, struct consumer_output *consumer, - enum lttng_stream_type type, uint64_t session_id) + enum lttng_stream_type type, uint64_t session_id, + char *session_name, char *hostname, int session_live_timer) { int ret; struct lttcomm_consumer_msg msg; @@ -955,6 +957,17 @@ int consumer_send_relayd_socket(struct consumer_socket *consumer_sock, goto error; } + if (type == LTTNG_STREAM_CONTROL) { + ret = relayd_create_session(rsock, + &msg.u.relayd_sock.relayd_session_id, + session_name, hostname, session_live_timer); + if (ret < 0) { + /* Close the control socket. */ + (void) relayd_close(rsock); + goto error; + } + } + msg.cmd_type = LTTNG_CONSUMER_ADD_RELAYD_SOCKET; /* * Assign network consumer output index using the temporary consumer since