X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=client.c;h=e6e4291b31d7715ed7f26426f7dee3f834a57fc0;hp=fb678e177363c7b5a5fb4d1438627dc15653a92e;hb=11e950bd785d9f03b7d35a8ee4b4704256217504;hpb=72c27ff8f2eaf945ae34776dab4da3fee753707d diff --git a/client.c b/client.c index fb678e17..e6e4291b 100644 --- a/client.c +++ b/client.c @@ -42,6 +42,8 @@ struct fio_client { int skip_newline; int is_sock; int disk_stats_shown; + unsigned int jobs; + int error; struct flist_head eta_list; struct client_eta *eta_in_flight; @@ -770,6 +772,22 @@ static void handle_probe(struct fio_client *client, struct fio_net_cmd *cmd) client->name = strdup((char *) probe->hostname); } +static void handle_start(struct fio_client *client, struct fio_net_cmd *cmd) +{ + struct cmd_start_pdu *pdu = (struct cmd_start_pdu *) cmd->payload; + + client->state = Client_started; + client->jobs = le32_to_cpu(pdu->jobs); +} + +static void handle_stop(struct fio_client *client, struct fio_net_cmd *cmd) +{ + struct cmd_end_pdu *pdu = (struct cmd_end_pdu *) cmd->payload; + + client->state = Client_stopped; + client->error = le32_to_cpu(pdu->error); +} + static int handle_client(struct fio_client *client) { struct fio_net_cmd *cmd; @@ -830,11 +848,11 @@ static int handle_client(struct fio_client *client) free(cmd); break; case FIO_NET_CMD_START: - client->state = Client_started; + handle_start(client, cmd); free(cmd); break; case FIO_NET_CMD_STOP: - client->state = Client_stopped; + handle_stop(client, cmd); free(cmd); break; default: