X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=ioengines.c;h=0f94d0d9513da64337bbb23284ebb09001b2ebd9;hp=d71e372048112e19010c1dd494a7a4b2872eb5fa;hb=6cfe9a8c89c2b8fb0b697e2f5f852ce6a5e82a2a;hpb=39a43d34f168d1921819f0a1f9b2f9800e68aaa1 diff --git a/ioengines.c b/ioengines.c index d71e3720..0f94d0d9 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); @@ -361,6 +375,9 @@ int td_io_init(struct thread_data *td) td->error = ret; } + if (!ret && (td->io_ops->flags & FIO_NOIO)) + td->flags |= TD_F_NOIO; + return ret; }