cli: mimic behavior of BT1 when trying to attach to live session
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Wed, 24 Apr 2019 20:13:07 +0000 (16:13 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:39 +0000 (18:19 -0400)
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 <francis.deslauriers@efficios.com>
Change-Id: I3b3810f97c090d102fd30902fda37434f62d5c01

cli/babeltrace-cfg-cli-args.c

index 159421650e5550f195f0520c3f73b374d217c6a7..06385a35d1e908edfd3b0c9bd0870894ecdf6210 100644 (file)
@@ -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
This page took 0.026313 seconds and 4 git commands to generate.