+/*
+ * Parse as if 'o' was a command line
+ */
+void add_job_opts(const char **o)
+{
+ struct thread_data *td, *td_parent;
+ int i, in_global = 1;
+ char jobname[32];
+
+ i = 0;
+ td_parent = td = NULL;
+ while (o[i]) {
+ if (!strncmp(o[i], "name", 4)) {
+ in_global = 0;
+ if (td)
+ add_job(td, jobname, 0);
+ td = NULL;
+ sprintf(jobname, "%s", o[i] + 5);
+ }
+ if (in_global && !td_parent)
+ td_parent = get_new_job(1, &def_thread);
+ else if (!in_global && !td) {
+ if (!td_parent)
+ td_parent = &def_thread;
+ td = get_new_job(0, td_parent);
+ }
+ if (in_global)
+ fio_options_parse(td_parent, (char **) &o[i], 1);
+ else
+ fio_options_parse(td, (char **) &o[i], 1);
+ i++;
+ }
+
+ if (td)
+ add_job(td, jobname, 0);
+}
+