gdk_threads_leave();
}
+static struct thread_options *gfio_client_add_job(struct gfio_client *gc,
+ struct thread_options_pack *top)
+{
+ struct gfio_client_options *gco;
+
+ gco = calloc(1, sizeof(*gco));
+ convert_thread_options_to_cpu(&gco->o, top);
+ flist_add_tail(&gco->list, &gc->o_list);
+ return &gco->o;
+}
+
static void gfio_add_job_op(struct fio_client *client, struct fio_net_cmd *cmd)
{
struct cmd_add_job_pdu *p = (struct cmd_add_job_pdu *) cmd->payload;
struct gfio_client *gc = client->client_data;
- struct thread_options *o = &gc->o;
struct gui_entry *ge = gc->ge;
+ struct thread_options *o;
char *c1, *c2, *c3, *c4;
char tmp[80];
p->thread_number = le32_to_cpu(p->thread_number);
p->groupid = le32_to_cpu(p->groupid);
- convert_thread_options_to_cpu(o, &p->top);
+ o = gfio_client_add_job(gc, &p->top);
gdk_threads_enter();
static void gfio_client_added(struct gui_entry *ge, struct fio_client *client)
{
+ struct gfio_client_options *gco;
struct gfio_client *gc;
- gc = malloc(sizeof(*gc));
- memset(gc, 0, sizeof(*gc));
- options_default_fill(&gc->o);
+ gc = calloc(1, sizeof(*gc));
+ INIT_FLIST_HEAD(&gc->o_list);
gc->ge = ge;
ge->client = gc;
gfio_set_client(gc, client);
+
+ /*
+ * Just add a default set of options, need to consider how best
+ * to handle this
+ */
+ gco = calloc(1, sizeof(*gco));
+ options_default_fill(&gco->o);
+ flist_add_tail(&gco->list, &gc->o_list);
}
static void connect_clicked(GtkWidget *widget, gpointer data)
ge = get_ge_from_cur_tab(ui);
if (ge && ge->client)
- gopt_get_options_window(ui->window, &ge->client->o);
+ gopt_get_options_window(ui->window, ge->client);
}
static void start_job_entry(GtkWidget *w, gpointer data)
struct thread_stat ts;
};
+struct gfio_client_options {
+ struct flist_head list;
+ struct thread_options o;
+};
+
struct gfio_client {
struct gui_entry *ge;
struct fio_client *client;
GtkWidget *err_entry;
- struct thread_options o;
+ struct flist_head o_list;
struct end_results *results;
unsigned int nr_results;
} while (1);
}
-void gopt_get_options_window(GtkWidget *window, struct thread_options *o)
+void gopt_get_options_window(GtkWidget *window, struct gfio_client *gc)
{
GtkWidget *dialog, *notebook;
GtkWidget *vboxes[__FIO_OPT_C_NR];
+ struct gfio_client_options *gco;
+ struct thread_options *o;
+
+ /*
+ * Just choose the first item, we need to make each options
+ * entry the main notebook, with the below options view as
+ * a sub-notebook
+ */
+ assert(!flist_empty(&gc->o_list));
+ gco = flist_entry(gc->o_list.next, struct gfio_client_options, list);
+ o = &gco->o;
dialog = gtk_dialog_new_with_buttons("Fio options",
GTK_WINDOW(window), GTK_DIALOG_DESTROY_WITH_PARENT,
#ifndef GFIO_OPTIONS_H
#define GFIO_OPTIONS_H
-void gopt_get_options_window(GtkWidget *window, struct thread_options *o);
+void gopt_get_options_window(GtkWidget *window, struct gfio_client *gc);
#endif