init: exiting with fio_show_ioengine_help return code
authorErwan Velu <e.velu@criteo.com>
Wed, 9 Sep 2020 16:31:25 +0000 (18:31 +0200)
committerErwan Velu <e.velu@criteo.com>
Wed, 9 Sep 2020 16:31:25 +0000 (18:31 +0200)
commit291a2d8569b0fb51257a18faf17867d022660499
treeedeb2df5d1d65e4f80e6dd9f7513cbfe275c5e65
parentca8ff0968cec7ee47ca7fe5b40f592c2b332b062
init: exiting with fio_show_ioengine_help return code

In the current code, calling --enghelp=<engine> always return 0.
But fio_show_ioengine_help() implemented a return code to inform when an engine is present or not.

This commit makes fio returning fio_show_ioengine_help() value when calling --enghelp=<engine>

A typical use case is detecting which engine is available on a given fio build.
It is possible to use the return code to determine if a given engine is available or not :

[user@host]# fio --enghelp=libaio
userspace_reap          : Use alternative user-space reap implementation
[user@host]# echo $?
0

[user@host]#fio --enghelp=io_uring
fio: engine io_uring not loadable
IO engine io_uring not found
[user@host]# echo $?
1

Signed-off-by: Erwan Velu <e.velu@criteo.com>
init.c