- if (!strncmp(engine, "linuxaio", 8) || !strncmp(engine, "aio", 3))
- strcpy(engine, "libaio");
+ if (ops->flags & FIO_SYNCIO)
+ return 0;
+
+ if (!ops->event) {
+ log_err("%s: no event handler\n", ops->name);
+ return 1;
+ }
+ if (!ops->getevents) {
+ log_err("%s: no getevents handler\n", ops->name);
+ return 1;
+ }
+ if (!ops->queue) {
+ log_err("%s: no queue handler\n", ops->name);
+ return 1;
+ }
+
+ return 0;
+}
+
+void unregister_ioengine(struct ioengine_ops *ops)
+{
+ list_del(&ops->list);
+ INIT_LIST_HEAD(&ops->list);
+}
+
+void register_ioengine(struct ioengine_ops *ops)
+{
+ INIT_LIST_HEAD(&ops->list);
+ list_add_tail(&ops->list, &engine_list);
+}
+
+static struct ioengine_ops *find_ioengine(const char *name)
+{
+ struct ioengine_ops *ops;
+ struct list_head *entry;
+
+ list_for_each(entry, &engine_list) {
+ ops = list_entry(entry, struct ioengine_ops, list);
+ if (!strcmp(name, ops->name))
+ return ops;
+ }
+
+ return NULL;
+}
+
+static struct ioengine_ops *dlopen_ioengine(struct thread_data *td,
+ const char *engine_lib)
+{
+ struct ioengine_ops *ops;
+ void *dlhandle;