From a6ddfe1212a2df72cacb0f44cc872b1bd0363c38 Mon Sep 17 00:00:00 2001 From: Frederic Robra Date: Tue, 17 Sep 2019 16:18:41 +0200 Subject: added client configuration for number connections --- src/client/client.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/client/client.c') diff --git a/src/client/client.c b/src/client/client.c index 37f0558..40542ba 100644 --- a/src/client/client.c +++ b/src/client/client.c @@ -43,13 +43,14 @@ static int openDevices[MAX_DEVS]; -static const char *optString = "f:h:i:r:d:a:cs:HV?k"; +static const char *optString = "f:h:i:r:d:n:a:cs:HV?k"; static const struct option longOpts[] = { { "file", required_argument, NULL, 'f' }, { "host", required_argument, NULL, 'h' }, { "image", required_argument, NULL, 'i' }, { "rid", required_argument, NULL, 'r' }, { "device", required_argument, NULL, 'd' }, + { "connections", required_argument, NULL, 'n'}, { "ahead", required_argument, NULL, 'a' }, { "close", no_argument, NULL, 'c' }, { "switch", required_argument, NULL, 's' }, @@ -231,6 +232,9 @@ int main(int argc, char *argv[]) dev = strdup( optarg ); printf( "Device is %s\n", dev ); break; + case 'n': + msg.number_connections = (uint8_t) atoi( optarg ); + break; case 'a': msg.read_ahead_kb = atoi( optarg ); break; @@ -652,6 +656,7 @@ static void dnbd3_print_help(char *argv_0) printf( "-i or --image \t\t Image name of exported image.\n" ); printf( "-r or --rid \t\t Release-ID of exported image (default 0, latest).\n" ); printf( "-d or --device \t\t DNBD3 device name.\n" ); + printf( "-n or --connections \t The number of parallel connections\n"); printf( "-a or --ahead \t\t Read ahead in KByte (default %i).\n", DEFAULT_READ_AHEAD_KB ); printf( "-c or --close \t\t Disconnect and close device.\n" ); printf( "-s or --switch \t\t Switch dnbd3-server on device (DEBUG).\n" ); -- cgit v1.2.3-55-g7522