fix dynamic engine loading for libaio engine etc
authorEric Sandeen <sandeen@redhat.com>
Mon, 9 Nov 2020 16:46:29 +0000 (10:46 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 Nov 2020 16:49:02 +0000 (09:49 -0700)
commit25b9b58e5f80c235bf125302624cfced4e7e198f
tree11287018d3e06b4932683aba5190ca9f176e8fa7
parentf4bd2c3d80bc35f76892205a7e50426711e3def3
fix dynamic engine loading for libaio engine etc

The dynamic engine loading for libaio (and some others) currently
fails because the dlopen routine is looking for ("lib%s", enginename)
which translates into "liblibiscsi.so":

openat(AT_FDCWD, "/usr/lib64/fio/liblibiscsi.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
Engine libiscsi not found; Either name is invalid, was not built, or fio-engine-libiscsi package is missing.
fio: engine libiscsi not loadable
IO engine libiscsi not found

The Makefile decide to name this engine "iscsi" instead of "libiscsi",
which leads to "libiscsi.so" not "liblibiscsi.so" hence the mismatch.

OTOH, "liblibiscsi.so" seems a bit bonkers.

Try to resolve all this by:

1) make all of the engine names match the documented engine names
   in the Makefile, i.e. "iscsi" -> "libiscsi"
2) change the created library filenames to "fio-$(ENGINENAME)"
   from "lib$(ENGINENAME)" to avoid the "liblib" prefix.

So now we consistently have the libraries named "fio-$(ENGINENAME).so"

fio-http.so
fio-libaio.so

etc.

Fixes: 5a8a6a03 ("configure: new --dynamic-libengines build option")
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Makefile
ioengines.c