Merge branch 'master' into gfio
[fio.git] / engines / net.c
index 6748a3e2b65a1185c76260d085c64d99bc11e1b9..636939ea932c86025a8aa733a1327a313e374b92 100644 (file)
@@ -53,25 +53,31 @@ static int str_hostname_cb(void *data, const char *input);
 static struct fio_option options[] = {
        {
                .name   = "hostname",
+               .lname  = "net engine hostname",
                .type   = FIO_OPT_STR_STORE,
                .cb     = str_hostname_cb,
                .help   = "Hostname for net IO engine",
+               .category = FIO_OPT_C_IO,
        },
        {
                .name   = "port",
+               .lname  = "net engine port",
                .type   = FIO_OPT_INT,
                .off1   = offsetof(struct netio_options, port),
                .minval = 1,
                .maxval = 65535,
                .help   = "Port to use for TCP or UDP net connections",
+               .category = FIO_OPT_C_IO,
        },
        {
                .name   = "protocol",
+               .lname  = "net engine protocol",
                .alias  = "proto",
                .type   = FIO_OPT_STR,
                .off1   = offsetof(struct netio_options, proto),
                .help   = "Network protocol to use",
                .def    = "tcp",
+               .category = FIO_OPT_C_IO,
                .posval = {
                          { .ival = "tcp",
                            .oval = FIO_TYPE_TCP,
@@ -89,9 +95,11 @@ static struct fio_option options[] = {
        },
        {
                .name   = "listen",
+               .lname  = "net engine listen",
                .type   = FIO_OPT_STR_SET,
                .off1   = offsetof(struct netio_options, listen),
                .help   = "Listen for incoming TCP connections",
+               .category = FIO_OPT_C_IO,
        },
        {
                .name   = NULL,
@@ -702,13 +710,17 @@ static int fio_netio_init(struct thread_data *td)
 
        if (o->proto != FIO_TYPE_TCP) {
                if (o->listen) {
-                         log_err("fio: listen only valid for TCP proto IO\n");
-                         return 1;
+                       log_err("fio: listen only valid for TCP proto IO\n");
+                       return 1;
                }
                if (td_rw(td)) {
-                         log_err("fio: datagram network connections must be"
+                       log_err("fio: datagram network connections must be"
                                   " read OR write\n");
-                         return 1;
+                       return 1;
+               }
+               if (o->proto == FIO_TYPE_UNIX && !td->o.filename) {
+                       log_err("fio: UNIX sockets need host/filename\n");
+                       return 1;
                }
                o->listen = td_read(td);
        }