X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=init.c;h=89c241f2500b0c689ceb0ac952d2d53bdf2a6543;hb=ea3c936ea2553dba0cc789a4ef197bc78261c841;hp=088e814ee2ff445f874f5c5b6e3a20e62995b999;hpb=132159a5a062cabfe963b3d57e82a80741bf5506;p=fio.git diff --git a/init.c b/init.c index 088e814e..89c241f2 100644 --- a/init.c +++ b/init.c @@ -46,8 +46,7 @@ char *exec_profile = NULL; int warnings_fatal = 0; int terse_version = 2; int is_backend = 0; -int is_client = 0; -char *client; +int nr_clients = 0; int write_bw_log = 0; int read_only = 0; @@ -177,16 +176,6 @@ static struct option l_opts[FIO_NR_OPTIONS] = { }, }; -FILE *get_f_out() -{ - return f_out; -} - -FILE *get_f_err() -{ - return f_err; -} - /* * Return a free job structure. */ @@ -1113,6 +1102,7 @@ struct debug_level debug_levels[] = { { .name = "mutex", .shift = FD_MUTEX }, { .name = "profile", .shift = FD_PROFILE }, { .name = "time", .shift = FD_TIME }, + { .name = "net", .shift = FD_NET }, { .name = NULL, }, }; @@ -1319,7 +1309,7 @@ static int parse_cmd_line(int argc, char *argv[]) } break; case 'S': - if (is_client) { + if (nr_clients) { log_err("fio: can't be both client and server\n"); do_exit++; exit_val = 1; @@ -1337,8 +1327,7 @@ static int parse_cmd_line(int argc, char *argv[]) exit_val = 1; break; } - is_client = 1; - client = strdup(optarg); + fio_client_add(optarg); break; default: do_exit++; @@ -1350,7 +1339,7 @@ static int parse_cmd_line(int argc, char *argv[]) if (do_exit) exit(exit_val); - if (is_client && fio_client_connect(client)) { + if (nr_clients && fio_clients_connect()) { do_exit++; exit_val = 1; return 1; @@ -1394,14 +1383,15 @@ int parse_options(int argc, char *argv[]) for (i = 0; i < job_files; i++) { if (fill_def_thread()) return 1; - if (is_client) { - if (fio_client_send_ini(ini_file[i])) + if (nr_clients) { + if (fio_clients_send_ini(ini_file[i])) return 1; - } else { + free(ini_file[i]); + } else if (!is_backend) { if (parse_jobs_ini(ini_file[i], 0, i)) return 1; + free(ini_file[i]); } - free(ini_file[i]); } free(ini_file); @@ -1412,7 +1402,7 @@ int parse_options(int argc, char *argv[]) return 0; if (exec_profile) return 0; - if (is_backend) + if (is_backend || nr_clients) return 0; log_err("No jobs(s) defined\n\n");