cli: check for cancellation before running the graph, add relevant logging
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 27 May 2017 02:23:41 +0000 (22:23 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 9 Jun 2017 20:58:11 +0000 (16:58 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
cli/babeltrace.c

index f63150a273632ff6d753592cd2ba854143339856..e547c40f19849db8aaab5d840077f6560657cfa8 100644 (file)
@@ -1736,6 +1736,13 @@ int cmd_run(struct bt_config *cfg)
                goto error;
        }
 
+       if (canceled) {
+               BT_LOGI_STR("Canceled by user before creating components.");
+               goto error;
+       }
+
+       BT_LOGI_STR("Creating components.");
+
        /* Create the requested component instances */
        if (cmd_run_ctx_create_components(&ctx)) {
                BT_LOGE_STR("Cannot create components.");
@@ -1743,6 +1750,13 @@ int cmd_run(struct bt_config *cfg)
                goto error;
        }
 
+       if (canceled) {
+               BT_LOGI_STR("Canceled by user before connecting components.");
+               goto error;
+       }
+
+       BT_LOGI_STR("Connecting components.");
+
        /* Connect the initially visible component ports */
        if (cmd_run_ctx_connect_ports(&ctx)) {
                BT_LOGE_STR("Cannot connect initial component ports.");
@@ -1751,7 +1765,8 @@ int cmd_run(struct bt_config *cfg)
        }
 
        if (canceled) {
-               goto end;
+               BT_LOGI_STR("Canceled by user before running the graph.");
+               goto error;
        }
 
        BT_LOGI_STR("Running the graph.");
This page took 0.025273 seconds and 4 git commands to generate.