+struct fio_client *fio_client_add_explicit(struct client_ops *ops,
+ const char *hostname, int type,
+ int port)
+{
+ struct fio_client *client;
+
+ client = malloc(sizeof(*client));
+ memset(client, 0, sizeof(*client));
+
+ INIT_FLIST_HEAD(&client->list);
+ INIT_FLIST_HEAD(&client->hash_list);
+ INIT_FLIST_HEAD(&client->arg_list);
+ INIT_FLIST_HEAD(&client->eta_list);
+ INIT_FLIST_HEAD(&client->cmd_list);
+
+ client->hostname = strdup(hostname);
+
+ if (type == Fio_client_socket)
+ client->is_sock = 1;
+ else {
+ int ipv6;
+
+ ipv6 = type == Fio_client_ipv6;
+ if (fio_server_parse_host(hostname, ipv6,
+ &client->addr.sin_addr,
+ &client->addr6.sin6_addr))
+ goto err;
+
+ client->port = port;
+ }
+
+ client->fd = -1;
+ client->ops = ops;
+ client->refs = 1;
+ client->type = ops->client_type;
+
+ __fio_client_add_cmd_option(client, "fio");
+
+ flist_add(&client->list, &client_list);
+ nr_clients++;
+ dprint(FD_NET, "client: added <%s>\n", client->hostname);
+ return client;
+err:
+ free(client);
+ return NULL;
+}
+
+int fio_client_add_ini_file(void *cookie, const char *ini_file, int remote)
+{
+ struct fio_client *client = cookie;
+ struct client_file *cf;
+ size_t new_size;
+ void *new_files;
+
+ dprint(FD_NET, "client <%s>: add ini %s\n", client->hostname, ini_file);
+
+ new_size = (client->nr_files + 1) * sizeof(struct client_file);
+ new_files = realloc(client->files, new_size);
+ if (!new_files)
+ return 1;
+
+ client->files = new_files;
+ cf = &client->files[client->nr_files];
+ cf->file = strdup(ini_file);
+ cf->remote = remote;
+ client->nr_files++;
+ return 0;
+}
+
+int fio_client_add(struct client_ops *ops, const char *hostname, void **cookie)