From: Simon Marchi Date: Tue, 20 Aug 2019 00:56:26 +0000 (-0400) Subject: autodisc: make it possible to interrupt auto source discovery X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=3dae1685cf1f1a368cd83928433eb778c8815dab;hp=3dae1685cf1f1a368cd83928433eb778c8815dab;p=babeltrace.git autodisc: make it possible to interrupt auto source discovery It is currently not possible to interrupt babeltrace2 while it is doing auto source discovery. However, it can be a quite long process that the user might want to interrupt using ctrl-C. This patch makes it possible to do that. An interrupter object is taken by the auto source discovery code and passed all the way to support_info_query_all_sources. In the CLI, the global `the_interrupter` object, which is set on sigint, is passed. Because support_info_query_all_sources (and other internal functions) can now return a few different values (success with a match, success without a match, error and interrupted), I changed it to return an enum type. The entry point of auto source discovery, auto_discover_source_components, can now return "interrupted" as well. However, since that function doesn't return "no match", I didn't want to make it use the same return type as support_info_query_all_sources. I therefore made an "internal" and public version of the status enum. With this patch, there is no way to interrupt an auto source discovery started from Python. Change-Id: I0040c7fab1887c4e05decd0659fa8ff3c85a16a1 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/1972 Tested-by: jenkins Reviewed-by: Francis Deslauriers ---