+ while (!flist_empty(&gjv_list)) {
+ gjv = flist_entry(gjv_list.next, struct gopt_job_view, list);
+ flist_del(&gjv->list);
+ free(gjv);
+ }
+}
+
+/*
+ * Build n-ary option dependency tree
+ */
+void gopt_init(void)
+{
+ int i;
+
+ gopt_dep_tree = g_node_new(NULL);
+
+ for (i = 0; fio_options[i].name; i++) {
+ struct fio_option *o = &fio_options[i];
+ GNode *node, *nparent;
+
+ /*
+ * Insert node with either the root parent, or an
+ * option parent.
+ */
+ node = g_node_new(o);
+ nparent = gopt_dep_tree;
+ if (o->parent) {
+ struct fio_option *parent;
+
+ parent = fio_option_find(o->parent);
+ nparent = g_node_find(gopt_dep_tree, G_IN_ORDER, G_TRAVERSE_ALL, parent);
+ if (!nparent) {
+ log_err("fio: did not find parent %s for opt %s\n", o->name, o->parent);
+ nparent = gopt_dep_tree;
+ }
+ }
+
+ g_node_insert(nparent, -1, node);
+ }
+}
+
+void gopt_exit(void)
+{