lib: rename INVALID_OBJECT status to UNKNOWN_OBJECT
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 24 Jul 2019 16:11:01 +0000 (12:11 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 7 Aug 2019 18:05:20 +0000 (14:05 -0400)
commit7dd3e7121e141c5f64a3efefc2aff424b3f62ae3
treeb4f9a2a83a22c054079993452e24aed26b4ef73b
parenta90c9738f505a87b4a5411facf8a63e4df166f50
lib: rename INVALID_OBJECT status to UNKNOWN_OBJECT

Rename INVALID_OBJECT to UNKNOWN_OBJECT, because it represents better
the situation: the passed object is not necessarily invalid (any string
is a valid object), it's just that the component class doesn't know that
object.

Change its numerical value to something positive, because it should not
be considered as an error (which negative numerical values represent).
A function returning UNKNOWN_OBJECT should not append an error cause.

Also, in the Python bindings, change the default implementation of
_query to raise bt2.UnknownObject instead of NotImplementedError.
NotImplementedError would result in an ERROR status code, whereas
bt2.UnknownObject becomes UNKNOWN_OBJECT.  This matches the behavior of
a component class implemented in C, where if it doesn't provide a query
method, it will automatically return UNKNOWN_OBJECT.

Change-Id: Ica1418272b5bf2bbe8e96d639c16f56191151d79
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1760
CI-Build: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
17 files changed:
include/babeltrace2/babeltrace.h
include/babeltrace2/func-status.h
include/babeltrace2/graph/component-class.h
include/babeltrace2/graph/query-executor.h
src/bindings/python/bt2/bt2/__init__.py
src/bindings/python/bt2/bt2/component.py
src/bindings/python/bt2/bt2/native_bt_component_class.i
src/bindings/python/bt2/bt2/utils.py
src/cli/babeltrace2.c
src/common/common.h
src/lib/func-status.h
src/lib/graph/query-executor.c
src/plugins/ctf/fs-src/fs.c
src/plugins/ctf/lttng-live/lttng-live.c
tests/bindings/python/bt2/test_component_class.py
tests/bindings/python/bt2/test_query_executor.py
tests/data/cli/auto-source-discovery/bt_plugin_test.py
This page took 0.028462 seconds and 4 git commands to generate.