If we invoke the client without arguments, it gets the probe
response and then waits for further response from the server.
But if no command line or job files were sent, the server
is idle. In that case, just quit.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
unsigned int jobs;
int error;
int ipv6;
unsigned int jobs;
int error;
int ipv6;
struct flist_head eta_list;
struct client_eta *eta_in_flight;
struct flist_head eta_list;
struct client_eta *eta_in_flight;
ret = fio_net_send_cmd(client->fd, FIO_NET_CMD_JOB, buf, sb.st_size, 0);
free(buf);
close(fd);
ret = fio_net_send_cmd(client->fd, FIO_NET_CMD_JOB, buf, sb.st_size, 0);
free(buf);
close(fd);
if (fio_client_send_ini(client, filename))
remove_client(client);
if (fio_client_send_ini(client, filename))
remove_client(client);
+
+ client->sent_job = 1;
int fio_handle_clients(void)
{
int fio_handle_clients(void)
{
- struct fio_client *client;
- struct flist_head *entry;
struct pollfd *pfds;
int i, ret = 0, retval = 0;
struct pollfd *pfds;
int i, ret = 0, retval = 0;
init_group_run_stat(&client_gs);
while (!exit_backend && nr_clients) {
init_group_run_stat(&client_gs);
while (!exit_backend && nr_clients) {
+ struct flist_head *entry, *tmp;
+ struct fio_client *client;
+
- flist_for_each(entry, &client_list) {
+ flist_for_each_safe(entry, tmp, &client_list) {
client = flist_entry(entry, struct fio_client, list);
client = flist_entry(entry, struct fio_client, list);
+ if (!client->sent_job &&
+ flist_empty(&client->cmd_list)) {
+ remove_client(client);
+ continue;
+ }
+
pfds[i].fd = client->fd;
pfds[i].events = POLLIN;
i++;
}
pfds[i].fd = client->fd;
pfds[i].events = POLLIN;
i++;
}
+ if (!nr_clients)
+ break;
+
assert(i == nr_clients);
do {
assert(i == nr_clients);
do {