Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP5:Update
nvme-cli
0005-nvme-cli-mask-out-invalid-options-during-d...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0005-nvme-cli-mask-out-invalid-options-during-discovery.patch of Package nvme-cli
From cb9701c80f861cc12a1d44f80958ee77da0c66c4 Mon Sep 17 00:00:00 2001 From: Hannes Reinecke <hare@suse.de> Date: Thu, 1 Aug 2019 10:47:41 +0200 Subject: [PATCH] nvme-cli: mask out invalid options during discovery When compiling the option string in build_options() we should ensure to not add invalid options when doing a discovery. So add an additional option 'discovery' to build_options() to identify these cases. Signed-off-by: Hannes Reinecke <hare@suse.com> --- fabrics.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/fabrics.c b/fabrics.c index b33bf93..95d9f5e 100644 --- a/fabrics.c +++ b/fabrics.c @@ -576,7 +576,7 @@ add_argument(char **argstr, int *max_len, char *arg_str, char *arg) return 0; } -static int build_options(char *argstr, int max_len) +static int build_options(char *argstr, int max_len, bool discover) { int len; @@ -607,15 +607,19 @@ static int build_options(char *argstr, int max_len) add_argument(&argstr, &max_len, "hostnqn", cfg.hostnqn)) || ((cfg.hostid || nvmf_hostid_file()) && add_argument(&argstr, &max_len, "hostid", cfg.hostid)) || - add_int_argument(&argstr, &max_len, "nr_io_queues", - cfg.nr_io_queues) || + (!discover && + add_int_argument(&argstr, &max_len, "nr_io_queues", + cfg.nr_io_queues)) || add_int_argument(&argstr, &max_len, "nr_write_queues", cfg.nr_write_queues) || add_int_argument(&argstr, &max_len, "nr_poll_queues", cfg.nr_poll_queues) || - add_int_argument(&argstr, &max_len, "queue_size", cfg.queue_size) || - add_int_argument(&argstr, &max_len, "keep_alive_tmo", - cfg.keep_alive_tmo) || + (!discover && + add_int_argument(&argstr, &max_len, "queue_size", + cfg.queue_size)) || + (!discover && + add_int_argument(&argstr, &max_len, "keep_alive_tmo", + cfg.keep_alive_tmo)) || add_int_argument(&argstr, &max_len, "reconnect_delay", cfg.reconnect_delay) || add_int_argument(&argstr, &max_len, "ctrl_loss_tmo", @@ -936,7 +940,7 @@ static int discover_from_conf_file(const char *desc, char *argstr, if (err) continue; - err = build_options(argstr, BUF_SIZE); + err = build_options(argstr, BUF_SIZE, true); if (err) { ret = err; continue; @@ -992,7 +996,7 @@ int discover(const char *desc, int argc, char **argv, bool connect) return discover_from_conf_file(desc, argstr, command_line_options, connect); } else { - ret = build_options(argstr, BUF_SIZE); + ret = build_options(argstr, BUF_SIZE, true); if (ret) return ret; @@ -1031,7 +1035,7 @@ int connect(const char *desc, int argc, char **argv) if (ret) return ret; - ret = build_options(argstr, BUF_SIZE); + ret = build_options(argstr, BUF_SIZE, false); if (ret) return ret; -- 2.22.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor