From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Marzinski Subject: Re: [PATCH v2 13/21] libmultipath: provide defaults for {get, put}_multipath_config Date: Fri, 25 Sep 2020 16:57:39 -0500 Message-ID: <20200925215739.GA3384@octiron.msp.redhat.com> References: <20200924133716.14120-1-mwilck@suse.com> <20200924133716.14120-14-mwilck@suse.com> <20200925043458.GO11108@octiron.msp.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com Content-Disposition: inline To: Martin Wilck Cc: dm-devel@redhat.com List-Id: dm-devel.ids On Fri, Sep 25, 2020 at 10:00:10PM +0200, Martin Wilck wrote: > On Thu, 2020-09-24 at 23:34 -0500, Benjamin Marzinski wrote: > > > > This causes problems with the libmpathvalid library code I > > wrote. The > > issue is that right now, when you run _init_config() if > > get_multipath_config() returns NULL, you will use the default > > loglevel. > > I would like the library user to have control of the log level, even > > during the calls to _init_config(). > > I see. So using init_config() actually had a benefit for you already > over load_config() :-) Such control over the verbosity would actually > be good for multipath-tools, too. > > > One possiblity would be to make init_config() take verbosity as an > > argument. There would also need to be some other config variable > > that > > gets set at the start of init_config(), which is used by > > libmp_get_multipath_config() to check if it is initialized. > > I suggest to track the verbosity independently in a different variable, > and just set it from init_config() if it was actually set in the > config file. Most of the time, we set it from the command line. > This would have the additional benefit not to have to call > get_multipath_config() in dlog(). Sure. That sounds like a much simpler solution than what I was proposing. -Ben > > Martin >