gfio: start of per-job option edit
Currently we don't properly handle job files with multiple
job entries in them, each one just overwrites the last.
Start tracking all of them.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/gclient.c b/gclient.c
index c4be172..31dbb68 100644
--- a/gclient.c
+++ b/gclient.c
@@ -550,18 +550,29 @@
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();