lib: make can_seek_beginning and can_seek_ns_from_origin methods return a status
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 6 Sep 2019 19:50:51 +0000 (15:50 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 3 Oct 2019 14:45:10 +0000 (10:45 -0400)
commit9e8e8b439ad3c7f6dd798e8ed2587bbdb3b873d8
tree70b766a93ce7b367990bff0501d572cdb422c381
parent6ef4e30ae9295339d19c777610e3c2648cab11f6
lib: make can_seek_beginning and can_seek_ns_from_origin methods return a status

The current situation is problematic: calling any of these methods on a
message iterator can result in running some user code, which can fail
for various reasons (e.g. any Python exception being raised and
escaping).  It is not possible to inform the caller of such failure, as
the return type of these methods is bt_bool.  This must change.

This patch changes them to return a status, and return the result by an
output parameter.

If the method returns OK, it must have set the output parameter to
BT_TRUE or BT_FALSE.  If it returns another status, the output parameter
value is unused.

Change-Id: Iaa3dcc1494e2a0fcbdbb14283af3bf8504cd8ef5
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2012
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
19 files changed:
include/babeltrace2/graph/component-class-filter.h
include/babeltrace2/graph/component-class-source.h
include/babeltrace2/graph/component-class.h
include/babeltrace2/graph/message-iterator.h
include/babeltrace2/graph/self-component-port-input-message-iterator.h
src/bindings/python/bt2/bt2/message_iterator.py
src/bindings/python/bt2/bt2/native_bt.i
src/bindings/python/bt2/bt2/native_bt_component_class.i.h
src/bindings/python/bt2/bt2/native_bt_log_and_append_error.h
src/lib/graph/iterator.c
src/lib/graph/message/iterator.h
src/plugins/lttng-utils/debug-info/debug-info.c
src/plugins/lttng-utils/debug-info/debug-info.h
src/plugins/text/dmesg/dmesg.c
src/plugins/text/dmesg/dmesg.h
src/plugins/utils/muxer/muxer.c
src/plugins/utils/muxer/muxer.h
src/plugins/utils/trimmer/trimmer.c
tests/bindings/python/bt2/test_message_iterator.py
This page took 0.026775 seconds and 4 git commands to generate.