libafb-helpers: Provide a way to get binding directory

Description

Here is an example of application framework binder launch to show the difference between 'binder root directory' and 'binding directory' :
`afb-daemon --name=afb-example --rootdir=/home/example/binder_rootdir --ldpaths=/home/example/other_bindings_dir --binding=/home/example/test_binding_dir/test.so -vvv`
In that configuration the 'binder root directory' is '/home/example/binder_rootdir', and it's the case for all bindings launched within the binder.
Nevertheless, for the binding 'test.so', the 'binding directory' is '/home/example/test_binding_dir/'. Moreover, if other bindings are found using '--ldpath=$PATH_TO_BINDINGS' option, all these bindings will have different 'binding directory' depending where they are located.

Current 'GetBindingDirPath' function is giving 'binder root directory' path. That's why I wanted to rename current 'GetBindingDirPath' to 'GetBinderRootDirPath'. And to implement a new 'GetBindingDirPath' function to be able to get 'binding directory'.

For regular afb service, the 'binder root directory' is set within the systemd service file. Often, an afb service binding is located in '$PATH_TO_AFB_SERVICE/lib/$NAME_OF_THE_BINDING.so', so the 'GetBindingDirPath' I want to implement would return '$PATH_TO_AFB_SERVICE/lib' where the current 'GetBindingDirPath' returns '$PATH_TO_AFB_SERVICE'.

The correction is required to improve 'libappcontroller' way of finding its plugins, especially when multiple bindings are launched within the same binder.

Environment

None

Activity

Walt Miner 
January 5, 2020 at 7:39 PM

Closed for Icefish RC4 release

Jonathan Aillet 
December 4, 2019 at 11:12 AM

Following discussion with and on gerrit review, I will use different names for new implementations of 'GetBinderRootDirPath' and 'GetBindingDirPath' to keep compatibility for applications that are already using current 'GetBindingDirPath' function.

Fixed

Details

Assignee

Reporter

Fix versions

Labels

Contract ID

Priority

Created December 3, 2019 at 4:11 PM
Updated January 5, 2020 at 7:39 PM
Resolved December 16, 2019 at 2:19 PM