From patchwork Thu Nov 11 18:53:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Marzinski X-Patchwork-Id: 12615565 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 850FAC433EF for ; Thu, 11 Nov 2021 18:54:43 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.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 347CF610F8 for ; Thu, 11 Nov 2021 18:54:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 347CF610F8 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=1636656882; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=PriznlsWeUX5MNTWU3MmP72s5vu/3yDA7wmQmw1M7uc=; b=GvbCFxif7YjtGqwUlxdYOgH+gmSHhGt5o14kgNt79Ve7k5ni2960LJ+gn8fVlVRLvxcxV8 BQfBSOP77IFRaL5K9wKgbCQXlx9mLWV+AIgjG4ECPqSRACY2OYs4k6BoOxJeizknH9V/m2 pi8c8zHHXYYCENJJq+t6aTcV3LVu/E4= 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-489-sZ4XIlGGNaCOqLfqUu9Enw-1; Thu, 11 Nov 2021 13:54:38 -0500 X-MC-Unique: sZ4XIlGGNaCOqLfqUu9Enw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DB3421006AA7; Thu, 11 Nov 2021 18:54:31 +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 9A3F917CE1; Thu, 11 Nov 2021 18:54:31 +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 735514EA30; Thu, 11 Nov 2021 18:54:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1ABIs9Pn027777 for ; Thu, 11 Nov 2021 13:54:09 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1DA0A104B4CA; Thu, 11 Nov 2021 18:54:09 +0000 (UTC) Received: from octiron.msp.redhat.com (unknown [10.15.80.209]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 017B11002D71; Thu, 11 Nov 2021 18:53:56 +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 1ABIrrlU026100; Thu, 11 Nov 2021 12:53:54 -0600 Received: (from bmarzins@localhost) by octiron.msp.redhat.com (8.14.9/8.14.9/Submit) id 1ABIrrIK026099; Thu, 11 Nov 2021 12:53:53 -0600 From: Benjamin Marzinski To: Christophe Varoqui Date: Thu, 11 Nov 2021 12:53:43 -0600 Message-Id: <1636656832-26062-1-git-send-email-bmarzins@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: dm-devel@redhat.com Cc: device-mapper development , Martin Wilck Subject: [dm-devel] [PATCH v3 0/9] improving config parsing warnings 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.14 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 This is a series of patches to make multipath provide better warnings when parsing multipath.conf. The first three patches fix small issues. The last six patches make multipath print warning messages with the file and line number, when it was previously either accepting invalid values or silently changing them. Changes from v2->v3, as suggested by Martin Wilck: 0007: still print the value of the deprecated options. 0008: revert to v1 patch Changes from v1->v2 (by v1 patch number), as suggested by Martin Wilck: 0005: use MAX_VEROSITY enum in the verbosity handler declaration. 0006: added a new patch, 0007, to warn that these options are now deprecated, and no longer print them when the have the default value. They are still used for now. 0007: functions that accept "0" as a special input value will now check if the integer gotten by do_set_int() is 0, and covert that to the special case. Benjamin Marzinski (9): libmultipath: add section name to invalid keyword output libmultipath: use typedef for keyword handler function libmultipath: print the correct file when parsing fails libmultipath: pass file and line number to keyword handlers libmultipath: make set_int take a range for valid values libmultipath: improve checks for set_str libmultipath: deprecate file and directory config options libmultipath: split set_int to enable reuse libmultipath: cleanup invalid config handling libmultipath/dict.c | 492 +++++++++++++++++++++++++------------ libmultipath/parser.c | 31 ++- libmultipath/parser.h | 15 +- multipath/multipath.conf.5 | 5 + 4 files changed, 365 insertions(+), 178 deletions(-)