From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FC45C433FE for ; Thu, 11 Nov 2021 01:08:13 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EF2B5611C9 for ; Thu, 11 Nov 2021 01:08:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EF2B5611C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=tempfail smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636592892; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=uysnnKcmerQQgcW+R9wCw+KYX1qZbsnhp3YYOw720bY=; b=AUOtuxkuoIncTzsjTJaMMX/45DZp6RPCABmT2KEB1mazaz+VToHsnRalaw1xEPCOkCE5ip BYMvNVo3jP+JZFyc6ZNpIIMYJfF3jYdxrxW7HakcRG2jpEvqYCZg2mcKIaNOqYuz0LQJLu xJLauBC2cWsAReU02lEbOv0/92OZ57c= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-259-GMUBWYr1PuqobkEvusUVgg-1; Wed, 10 Nov 2021 20:07:08 -0500 X-MC-Unique: GMUBWYr1PuqobkEvusUVgg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A423E1966320; Thu, 11 Nov 2021 01:07:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8256856A89; Thu, 11 Nov 2021 01:07:04 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 57E994E9F5; Thu, 11 Nov 2021 01:07:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1AB16cuN013160 for ; Wed, 10 Nov 2021 20:06:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4B42360CA0; Thu, 11 Nov 2021 01:06:38 +0000 (UTC) Received: from octiron.msp.redhat.com (unknown [10.15.80.209]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 28D7760CC4; Thu, 11 Nov 2021 01:06:38 +0000 (UTC) Received: from octiron.msp.redhat.com (localhost.localdomain [127.0.0.1]) by octiron.msp.redhat.com (8.14.9/8.14.9) with ESMTP id 1AB16ZnH020457; Wed, 10 Nov 2021 19:06:36 -0600 Received: (from bmarzins@localhost) by octiron.msp.redhat.com (8.14.9/8.14.9/Submit) id 1AB16ZM2020456; Wed, 10 Nov 2021 19:06:35 -0600 From: Benjamin Marzinski To: Christophe Varoqui Date: Wed, 10 Nov 2021 19:06:18 -0600 Message-Id: <1636592780-20391-8-git-send-email-bmarzins@redhat.com> In-Reply-To: <1636592780-20391-1-git-send-email-bmarzins@redhat.com> References: <1636592780-20391-1-git-send-email-bmarzins@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: dm-devel@redhat.com Cc: device-mapper development , Martin Wilck Subject: [dm-devel] [PATCH v2 7/9] libmultipath: deprecate file and directory config options X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Having multipath able to select pathnames for the files and directories it needs causes unnecessary maintainer headaches. Mark these as deprecated, but still support them for now. Signed-off-by: Benjamin Marzinski --- libmultipath/dict.c | 40 +++++++++++++++++++++++++++++--------- multipath/multipath.conf.5 | 5 +++++ 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/libmultipath/dict.c b/libmultipath/dict.c index 149d3348..1b4e1106 100644 --- a/libmultipath/dict.c +++ b/libmultipath/dict.c @@ -268,6 +268,15 @@ def_ ## option ## _handler (struct config *conf, vector strvec, \ return function (strvec, &conf->option, file, line_nr); \ } +#define declare_def_warn_handler(option, function) \ +static int \ +def_ ## option ## _handler (struct config *conf, vector strvec, \ + const char *file, int line_nr) \ +{ \ + condlog(2, "%s line %d, \"" #option "\" is deprecated and will be disabled in a future release", file, line_nr); \ + return function (strvec, &conf->option, file, line_nr); \ +} + #define declare_def_range_handler(option, minval, maxval) \ static int \ def_ ## option ## _handler (struct config *conf, vector strvec, \ @@ -284,6 +293,17 @@ snprint_def_ ## option (struct config *conf, struct strbuf *buff, \ return function(buff, conf->option); \ } +#define declare_def_snprint_non_defstr(option, function, value) \ +static int \ +snprint_def_ ## option (struct config *conf, struct strbuf *buff, \ + const void *data) \ +{ \ + static const char *s = value; \ + if (!conf->option || strcmp(conf->option, s) == 0) \ + return 0; \ + return function(buff, conf->option); \ +} + #define declare_def_snprint_defint(option, function, value) \ static int \ snprint_def_ ## option (struct config *conf, struct strbuf *buff, \ @@ -421,8 +441,8 @@ declare_def_snprint(verbosity, print_int) declare_def_handler(reassign_maps, set_yes_no) declare_def_snprint(reassign_maps, print_yes_no) -declare_def_handler(multipath_dir, set_dir) -declare_def_snprint(multipath_dir, print_str) +declare_def_warn_handler(multipath_dir, set_dir) +declare_def_snprint_non_defstr(multipath_dir, print_str, DEFAULT_MULTIPATHDIR) static int def_partition_delim_handler(struct config *conf, vector strvec, const char *file, int line_nr) @@ -654,14 +674,14 @@ declare_hw_snprint(user_friendly_names, print_yes_no_undef) declare_mp_handler(user_friendly_names, set_yes_no_undef) declare_mp_snprint(user_friendly_names, print_yes_no_undef) -declare_def_handler(bindings_file, set_path) -declare_def_snprint(bindings_file, print_str) +declare_def_warn_handler(bindings_file, set_path) +declare_def_snprint_non_defstr(bindings_file, print_str, DEFAULT_BINDINGS_FILE) -declare_def_handler(wwids_file, set_path) -declare_def_snprint(wwids_file, print_str) +declare_def_warn_handler(wwids_file, set_path) +declare_def_snprint_non_defstr(wwids_file, print_str, DEFAULT_WWIDS_FILE) -declare_def_handler(prkeys_file, set_path) -declare_def_snprint(prkeys_file, print_str) +declare_def_warn_handler(prkeys_file, set_path) +declare_def_snprint_non_defstr(prkeys_file, print_str, DEFAULT_PRKEYS_FILE) declare_def_handler(retain_hwhandler, set_yes_no_undef) declare_def_snprint_defint(retain_hwhandler, print_yes_no_undef, @@ -760,9 +780,11 @@ def_config_dir_handler(struct config *conf, vector strvec, const char *file, /* this is only valid in the main config file */ if (conf->processed_main_config) return 0; + condlog(2, "%s line %d, \"config_dir\" is deprecated and will be disabled in a future release", + file, line_nr); return set_path(strvec, &conf->config_dir, file, line_nr); } -declare_def_snprint(config_dir, print_str) +declare_def_snprint_non_defstr(config_dir, print_str, DEFAULT_CONFIG_DIR) #define declare_def_attr_handler(option, function) \ static int \ diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 index 42a15ffd..17771e27 100644 --- a/multipath/multipath.conf.5 +++ b/multipath/multipath.conf.5 @@ -178,6 +178,7 @@ The default is: \fBno\fR . .TP .B multipath_dir +This option is deprecated, and will be removed in a future release. Directory where the dynamic shared objects are stored. Defined at compile time, commonly \fI/lib64/multipath/\fR or \fI/lib/multipath/\fR. .RS @@ -742,6 +743,7 @@ The default is: \fB\fR . .TP .B bindings_file +This option is deprecated, and will be removed in a future release. The full pathname of the binding file to be used when the user_friendly_names option is set. .RS @@ -752,6 +754,7 @@ The default is: \fB/etc/multipath/bindings\fR . .TP .B wwids_file +This option is deprecated, and will be removed in a future release. The full pathname of the WWIDs file, which is used by multipath to keep track of the WWIDs for LUNs it has created multipath devices on in the past. .RS @@ -762,6 +765,7 @@ The default is: \fB/etc/multipath/wwids\fR . .TP .B prkeys_file +This option is deprecated, and will be removed in a future release. The full pathname of the prkeys file, which is used by multipathd to keep track of the persistent reservation key used for a specific WWID, when \fIreservation_key\fR is set to \fBfile\fR. @@ -933,6 +937,7 @@ The default is: \fB\fR . .TP .B config_dir +This option is deprecated, and will be removed in a future release. If set to anything other than "", multipath will search this directory alphabetically for file ending in ".conf" and it will read configuration information from them, just as if it was in \fI/etc/multipath.conf\fR. -- 2.17.2 -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel