X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=ioengines.c;h=3c75fa6bfed6812e9027e832ff0d26505034b7d9;hb=0d978694d1518e75fb0f58e26ca28448945339ca;hp=d71e372048112e19010c1dd494a7a4b2872eb5fa;hpb=39a43d34f168d1921819f0a1f9b2f9800e68aaa1;p=fio.git diff --git a/ioengines.c b/ioengines.c index d71e3720..3c75fa6b 100644 --- a/ioengines.c +++ b/ioengines.c @@ -107,6 +107,20 @@ static struct ioengine_ops *dlopen_ioengine(struct thread_data *td, ops = dlsym(dlhandle, engine_lib); if (!ops) ops = dlsym(dlhandle, "ioengine"); + + /* + * For some external engines (like C++ ones) it is not that trivial + * to provide a non-static ionengine structure that we can reference. + * Instead we call a method which allocates the required ioengine + * structure. + */ + if (!ops) { + get_ioengine_t get_ioengine = dlsym(dlhandle, "get_ioengine"); + + if (get_ioengine) + get_ioengine(&ops); + } + if (!ops) { td_vmsg(td, -1, dlerror(), "dlsym"); dlclose(dlhandle);