[PATCH 11/35] monitor: add option -A / --autoconnect

Hannes Reinecke hare at suse.de
Thu Feb 4 02:13:08 EST 2021


On 1/26/21 9:33 PM, mwilck at suse.com wrote:
> From: Martin Wilck <mwilck at suse.com>
> 
> With this option, the monitor will try to connect to newly discovered
> controllers.
> 
> Signed-off-by: Martin Wilck <mwilck at suse.com>
> ---
>   monitor.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/monitor.c b/monitor.c
> index a7afa1c..ecf3be2 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -31,6 +31,10 @@
>   #define LOG_FUNCNAME 1
>   #include "log.h"
>   
> +static struct monitor_config {
> +	bool autoconnect;
> +} mon_cfg;
> +
>   static struct udev *udev;
>   
>   static void close_ptr(int *p)
> @@ -177,6 +181,7 @@ static int monitor_parse_opts(const char *desc, int argc, char **argv)
>   	bool debug = false;
>   	int ret;
>   	OPT_ARGS(opts) = {
> +		OPT_FLAG("autoconnect",    'A', &mon_cfg.autoconnect, "automatically connect newly discovered controllers"),
>   		OPT_FLAG("silent",         'S', &quiet,               "log level: silent"),
>   		OPT_FLAG("verbose",        'v', &verbose,             "log level: verbose"),
>   		OPT_FLAG("debug",          'D', &debug,               "log level: debug"),
> 
This patch is slightly confusing.

It just adds an option, but there is not code evaluating this option. So 
where does it hook in?

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare at suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer



More information about the Linux-nvme mailing list