From: Francis Deslauriers Date: Wed, 24 Apr 2019 20:13:07 +0000 (-0400) Subject: cli: mimic behavior of BT1 when trying to attach to live session X-Git-Tag: v2.0.0-pre5~60 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=1e20174de25333862f77d17151525224afbb0662 cli: mimic behavior of BT1 when trying to attach to live session In Babeltrace 1, when trying to attach to a LTTng live session the `babeltrace` command would exit with status 0 (SUCCESS) if it successfully connected to the relay daemon _even if_ it did not find the requested session. To mimic the behavior of BT1, we set the `session-not-found-action` parameter to "end". This makes the message iterator of an lttng-live component return a END status if the requested session is not found on the relay daemon and makes the cli return gracefully with SUCCESS. Signed-off-by: Francis Deslauriers Change-Id: I3b3810f97c090d102fd30902fda37434f62d5c01 --- diff --git a/cli/babeltrace-cfg-cli-args.c b/cli/babeltrace-cfg-cli-args.c index 15942165..06385a35 100644 --- a/cli/babeltrace-cfg-cli-args.c +++ b/cli/babeltrace-cfg-cli-args.c @@ -4521,6 +4521,13 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[], if (ret) { goto error; } + + ret = append_implicit_component_extra_param( + &implicit_lttng_live_args, + "session-not-found-action", "end"); + if (ret) { + goto error; + } } else { /* * Create one source.ctf.fs component, pass it an array