+struct ioengine_ops *load_ioengine(struct thread_data *td, const char *name)
+{
+ struct ioengine_ops *ops, *ret;
+ char engine[16];
+
+ strncpy(engine, name, sizeof(engine) - 1);
+
+ /*
+ * linux libaio has alias names, so convert to what we want
+ */
+ if (!strncmp(engine, "linuxaio", 8) || !strncmp(engine, "aio", 3))
+ strcpy(engine, "libaio");
+
+ ops = find_ioengine(engine);
+ if (!ops)
+ ops = dlopen_ioengine(td, name);
+
+ if (!ops) {
+ log_err("fio: engine %s not loadable\n", name);
+ return NULL;
+ }
+
+ /*
+ * Check that the required methods are there.
+ */
+ if (check_engine_ops(ops))
+ return NULL;
+
+ ret = malloc(sizeof(*ret));
+ memcpy(ret, ops, sizeof(*ret));
+ ret->data = NULL;
+
+ return ret;
+}
+