Blame SOURCES/0026-libmultipath-pass-file-and-line-number-to-keyword-ha.patch

e65fa3
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
e65fa3
From: Benjamin Marzinski <bmarzins@redhat.com>
e65fa3
Date: Fri, 24 Sep 2021 17:59:12 -0500
e65fa3
Subject: [PATCH] libmultipath: pass file and line number to keyword handlers
e65fa3
e65fa3
This will make it possible for the keyword handlers to print more useful
e65fa3
warning messages. It will be used by future patches.
e65fa3
e65fa3
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
e65fa3
---
e65fa3
 libmultipath/dict.c   | 143 +++++++++++++++++++++++++-----------------
e65fa3
 libmultipath/parser.c |   3 +-
e65fa3
 libmultipath/parser.h |   2 +-
e65fa3
 3 files changed, 90 insertions(+), 58 deletions(-)
e65fa3
e65fa3
diff --git a/libmultipath/dict.c b/libmultipath/dict.c
e65fa3
index 7a727389..eb2c44c0 100644
e65fa3
--- a/libmultipath/dict.c
e65fa3
+++ b/libmultipath/dict.c
e65fa3
@@ -29,7 +29,7 @@
e65fa3
 #include "strbuf.h"
e65fa3
 
e65fa3
 static int
e65fa3
-set_int(vector strvec, void *ptr)
e65fa3
+set_int(vector strvec, void *ptr, const char *file, int line_nr)
e65fa3
 {
e65fa3
 	int *int_ptr = (int *)ptr;
e65fa3
 	char *buff, *eptr;
e65fa3
@@ -58,7 +58,7 @@ set_int(vector strvec, void *ptr)
e65fa3
 }
e65fa3
 
e65fa3
 static int
e65fa3
-set_uint(vector strvec, void *ptr)
e65fa3
+set_uint(vector strvec, void *ptr, const char *file, int line_nr)
e65fa3
 {
e65fa3
 	unsigned int *uint_ptr = (unsigned int *)ptr;
e65fa3
 	char *buff, *eptr, *p;
e65fa3
@@ -90,7 +90,7 @@ set_uint(vector strvec, void *ptr)
e65fa3
 }
e65fa3
 
e65fa3
 static int
e65fa3
-set_str(vector strvec, void *ptr)
e65fa3
+set_str(vector strvec, void *ptr, const char *file, int line_nr)
e65fa3
 {
e65fa3
 	char **str_ptr = (char **)ptr;
e65fa3
 
e65fa3
@@ -105,7 +105,7 @@ set_str(vector strvec, void *ptr)
e65fa3
 }
e65fa3
 
e65fa3
 static int
e65fa3
-set_yes_no(vector strvec, void *ptr)
e65fa3
+set_yes_no(vector strvec, void *ptr, const char *file, int line_nr)
e65fa3
 {
e65fa3
 	char * buff;
e65fa3
 	int *int_ptr = (int *)ptr;
e65fa3
@@ -124,7 +124,7 @@ set_yes_no(vector strvec, void *ptr)
e65fa3
 }
e65fa3
 
e65fa3
 static int
e65fa3
-set_yes_no_undef(vector strvec, void *ptr)
e65fa3
+set_yes_no_undef(vector strvec, void *ptr, const char *file, int line_nr)
e65fa3
 {
e65fa3
 	char * buff;
e65fa3
 	int *int_ptr = (int *)ptr;
e65fa3
@@ -187,9 +187,10 @@ static int print_yes_no_undef(struct strbuf *buff, long v)
e65fa3
 
e65fa3
 #define declare_def_handler(option, function)				\
e65fa3
 static int								\
e65fa3
-def_ ## option ## _handler (struct config *conf, vector strvec)		\
e65fa3
+def_ ## option ## _handler (struct config *conf, vector strvec,		\
e65fa3
+			    const char *file, int line_nr)		\
e65fa3
 {									\
e65fa3
-	return function (strvec, &conf->option);			\
e65fa3
+	return function (strvec, &conf->option, file, line_nr);		\
e65fa3
 }
e65fa3
 
e65fa3
 #define declare_def_snprint(option, function)				\
e65fa3
@@ -224,12 +225,13 @@ snprint_def_ ## option (struct config *conf, struct strbuf *buff,	\
e65fa3
 
e65fa3
 #define declare_hw_handler(option, function)				\
e65fa3
 static int								\
e65fa3
-hw_ ## option ## _handler (struct config *conf, vector strvec)		\
e65fa3
+hw_ ## option ## _handler (struct config *conf, vector strvec,		\
e65fa3
+			   const char *file, int line_nr)		\
e65fa3
 {									\
e65fa3
 	struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);		\
e65fa3
 	if (!hwe)							\
e65fa3
 		return 1;						\
e65fa3
-	return function (strvec, &hwe->option);				\
e65fa3
+	return function (strvec, &hwe->option, file, line_nr);		\
e65fa3
 }
e65fa3
 
e65fa3
 #define declare_hw_snprint(option, function)				\
e65fa3
@@ -243,11 +245,12 @@ snprint_hw_ ## option (struct config *conf, struct strbuf *buff,	\
e65fa3
 
e65fa3
 #define declare_ovr_handler(option, function)				\
e65fa3
 static int								\
e65fa3
-ovr_ ## option ## _handler (struct config *conf, vector strvec)		\
e65fa3
+ovr_ ## option ## _handler (struct config *conf, vector strvec,		\
e65fa3
+			    const char *file, int line_nr)		\
e65fa3
 {									\
e65fa3
 	if (!conf->overrides)						\
e65fa3
 		return 1;						\
e65fa3
-	return function (strvec, &conf->overrides->option);		\
e65fa3
+	return function (strvec, &conf->overrides->option, file, line_nr); \
e65fa3
 }
e65fa3
 
e65fa3
 #define declare_ovr_snprint(option, function)				\
e65fa3
@@ -260,12 +263,13 @@ snprint_ovr_ ## option (struct config *conf, struct strbuf *buff,	\
e65fa3
 
e65fa3
 #define declare_mp_handler(option, function)				\
e65fa3
 static int								\
e65fa3
-mp_ ## option ## _handler (struct config *conf, vector strvec)		\
e65fa3
+mp_ ## option ## _handler (struct config *conf, vector strvec,		\
e65fa3
+			   const char *file, int line_nr)		\
e65fa3
 {									\
e65fa3
 	struct mpentry * mpe = VECTOR_LAST_SLOT(conf->mptable);		\
e65fa3
 	if (!mpe)							\
e65fa3
 		return 1;						\
e65fa3
-	return function (strvec, &mpe->option);				\
e65fa3
+	return function (strvec, &mpe->option, file, line_nr);		\
e65fa3
 }
e65fa3
 
e65fa3
 #define declare_mp_snprint(option, function)				\
e65fa3
@@ -277,9 +281,10 @@ snprint_mp_ ## option (struct config *conf, struct strbuf *buff,	\
e65fa3
 	return function(buff, mpe->option);				\
e65fa3
 }
e65fa3
 
e65fa3
-static int checkint_handler(struct config *conf, vector strvec)
e65fa3
+static int checkint_handler(struct config *conf, vector strvec,
e65fa3
+			    const char *file, int line_nr)
e65fa3
 {
e65fa3
-	int rc = set_uint(strvec, &conf->checkint);
e65fa3
+	int rc = set_uint(strvec, &conf->checkint, file, line_nr);
e65fa3
 
e65fa3
 	if (rc)
e65fa3
 		return rc;
e65fa3
@@ -302,9 +307,10 @@ declare_def_snprint(reassign_maps, print_yes_no)
e65fa3
 declare_def_handler(multipath_dir, set_str)
e65fa3
 declare_def_snprint(multipath_dir, print_str)
e65fa3
 
e65fa3
-static int def_partition_delim_handler(struct config *conf, vector strvec)
e65fa3
+static int def_partition_delim_handler(struct config *conf, vector strvec,
e65fa3
+				       const char *file, int line_nr)
e65fa3
 {
e65fa3
-	int rc = set_str(strvec, &conf->partition_delim);
e65fa3
+	int rc = set_str(strvec, &conf->partition_delim, file, line_nr);
e65fa3
 
e65fa3
 	if (rc != 0)
e65fa3
 		return rc;
e65fa3
@@ -334,13 +340,13 @@ static const char * const find_multipaths_optvals[] = {
e65fa3
 };
e65fa3
 
e65fa3
 static int
e65fa3
-def_find_multipaths_handler(struct config *conf, vector strvec)
e65fa3
+def_find_multipaths_handler(struct config *conf, vector strvec,
e65fa3
+			    const char *file, int line_nr)
e65fa3
 {
e65fa3
 	char *buff;
e65fa3
 	int i;
e65fa3
 
e65fa3
-	if (set_yes_no_undef(strvec, &conf->find_multipaths) == 0 &&
e65fa3
-	    conf->find_multipaths != FIND_MULTIPATHS_UNDEF)
e65fa3
+	if (set_yes_no_undef(strvec, &conf->find_multipaths, file, line_nr) == 0 && conf->find_multipaths != FIND_MULTIPATHS_UNDEF)
e65fa3
 		return 0;
e65fa3
 
e65fa3
 	buff = set_value(strvec);
e65fa3
@@ -396,7 +402,8 @@ static int snprint_uid_attrs(struct config *conf, struct strbuf *buff,
e65fa3
 	return total;
e65fa3
 }
e65fa3
 
e65fa3
-static int uid_attrs_handler(struct config *conf, vector strvec)
e65fa3
+static int uid_attrs_handler(struct config *conf, vector strvec,
e65fa3
+			     const char *file, int line_nr)
e65fa3
 {
e65fa3
 	char *val;
e65fa3
 
e65fa3
@@ -597,7 +604,8 @@ declare_hw_handler(skip_kpartx, set_yes_no_undef)
e65fa3
 declare_hw_snprint(skip_kpartx, print_yes_no_undef)
e65fa3
 declare_mp_handler(skip_kpartx, set_yes_no_undef)
e65fa3
 declare_mp_snprint(skip_kpartx, print_yes_no_undef)
e65fa3
-static int def_disable_changed_wwids_handler(struct config *conf, vector strvec)
e65fa3
+static int def_disable_changed_wwids_handler(struct config *conf, vector strvec,
e65fa3
+					     const char *file, int line_nr)
e65fa3
 {
e65fa3
 	return 0;
e65fa3
 }
e65fa3
@@ -629,20 +637,23 @@ declare_def_snprint_defstr(enable_foreign, print_str,
e65fa3
 			   DEFAULT_ENABLE_FOREIGN)
e65fa3
 
e65fa3
 static int
e65fa3
-def_config_dir_handler(struct config *conf, vector strvec)
e65fa3
+def_config_dir_handler(struct config *conf, vector strvec, const char *file,
e65fa3
+		       int line_nr)
e65fa3
 {
e65fa3
 	/* this is only valid in the main config file */
e65fa3
 	if (conf->processed_main_config)
e65fa3
 		return 0;
e65fa3
-	return set_str(strvec, &conf->config_dir);
e65fa3
+	return set_str(strvec, &conf->config_dir, file, line_nr);
e65fa3
 }
e65fa3
 declare_def_snprint(config_dir, print_str)
e65fa3
 
e65fa3
 #define declare_def_attr_handler(option, function)			\
e65fa3
 static int								\
e65fa3
-def_ ## option ## _handler (struct config *conf, vector strvec)		\
e65fa3
+def_ ## option ## _handler (struct config *conf, vector strvec,		\
e65fa3
+			    const char *file, int line_nr)		\
e65fa3
 {									\
e65fa3
-	return function (strvec, &conf->option, &conf->attribute_flags);\
e65fa3
+	return function (strvec, &conf->option, &conf->attribute_flags, \
e65fa3
+			 file, line_nr);				\
e65fa3
 }
e65fa3
 
e65fa3
 #define declare_def_attr_snprint(option, function)			\
e65fa3
@@ -655,12 +666,14 @@ snprint_def_ ## option (struct config *conf, struct strbuf *buff,	\
e65fa3
 
e65fa3
 #define declare_mp_attr_handler(option, function)			\
e65fa3
 static int								\
e65fa3
-mp_ ## option ## _handler (struct config *conf, vector strvec)		\
e65fa3
+mp_ ## option ## _handler (struct config *conf, vector strvec,		\
e65fa3
+			   const char *file, int line_nr)		\
e65fa3
 {									\
e65fa3
 	struct mpentry * mpe = VECTOR_LAST_SLOT(conf->mptable);		\
e65fa3
 	if (!mpe)							\
e65fa3
 		return 1;						\
e65fa3
-	return function (strvec, &mpe->option, &mpe->attribute_flags);	\
e65fa3
+	return function (strvec, &mpe->option, &mpe->attribute_flags,	\
e65fa3
+			 file, line_nr);				\
e65fa3
 }
e65fa3
 
e65fa3
 #define declare_mp_attr_snprint(option, function)			\
e65fa3
@@ -673,7 +686,7 @@ snprint_mp_ ## option (struct config *conf, struct strbuf *buff,	\
e65fa3
 }
e65fa3
 
e65fa3
 static int
e65fa3
-set_mode(vector strvec, void *ptr, int *flags)
e65fa3
+set_mode(vector strvec, void *ptr, int *flags, const char *file, int line_nr)
e65fa3
 {
e65fa3
 	mode_t mode;
e65fa3
 	mode_t *mode_ptr = (mode_t *)ptr;
e65fa3
@@ -694,7 +707,7 @@ set_mode(vector strvec, void *ptr, int *flags)
e65fa3
 }
e65fa3
 
e65fa3
 static int
e65fa3
-set_uid(vector strvec, void *ptr, int *flags)
e65fa3
+set_uid(vector strvec, void *ptr, int *flags, const char *file, int line_nr)
e65fa3
 {
e65fa3
 	uid_t uid;
e65fa3
 	uid_t *uid_ptr = (uid_t *)ptr;
e65fa3
@@ -719,7 +732,7 @@ set_uid(vector strvec, void *ptr, int *flags)
e65fa3
 }
e65fa3
 
e65fa3
 static int
e65fa3
-set_gid(vector strvec, void *ptr, int *flags)
e65fa3
+set_gid(vector strvec, void *ptr, int *flags, const char *file, int line_nr)
e65fa3
 {
e65fa3
 	gid_t gid;
e65fa3
 	gid_t *gid_ptr = (gid_t *)ptr;
e65fa3
@@ -786,7 +799,7 @@ declare_mp_attr_handler(gid, set_gid)
e65fa3
 declare_mp_attr_snprint(gid, print_gid)
e65fa3
 
e65fa3
 static int
e65fa3
-set_undef_off_zero(vector strvec, void *ptr)
e65fa3
+set_undef_off_zero(vector strvec, void *ptr, const char *file, int line_nr)
e65fa3
 {
e65fa3
 	char * buff;
e65fa3
 	int *int_ptr = (int *)ptr;
e65fa3
@@ -827,7 +840,7 @@ declare_hw_handler(fast_io_fail, set_undef_off_zero)
e65fa3
 declare_hw_snprint(fast_io_fail, print_undef_off_zero)
e65fa3
 
e65fa3
 static int
e65fa3
-set_dev_loss(vector strvec, void *ptr)
e65fa3
+set_dev_loss(vector strvec, void *ptr, const char *file, int line_nr)
e65fa3
 {
e65fa3
 	char * buff;
e65fa3
 	unsigned int *uint_ptr = (unsigned int *)ptr;
e65fa3
@@ -870,7 +883,7 @@ declare_hw_handler(eh_deadline, set_undef_off_zero)
e65fa3
 declare_hw_snprint(eh_deadline, print_undef_off_zero)
e65fa3
 
e65fa3
 static int
e65fa3
-set_pgpolicy(vector strvec, void *ptr)
e65fa3
+set_pgpolicy(vector strvec, void *ptr, const char *file, int line_nr)
e65fa3
 {
e65fa3
 	char * buff;
e65fa3
 	int *int_ptr = (int *)ptr;
e65fa3
@@ -936,7 +949,8 @@ get_sys_max_fds(int *max_fds)
e65fa3
 
e65fa3
 
e65fa3
 static int
e65fa3
-max_fds_handler(struct config *conf, vector strvec)
e65fa3
+max_fds_handler(struct config *conf, vector strvec, const char *file,
e65fa3
+		int line_nr)
e65fa3
 {
e65fa3
 	char * buff;
e65fa3
 	int r = 0, max_fds;
e65fa3
@@ -981,7 +995,7 @@ snprint_max_fds (struct config *conf, struct strbuf *buff, const void *data)
e65fa3
 }
e65fa3
 
e65fa3
 static int
e65fa3
-set_rr_weight(vector strvec, void *ptr)
e65fa3
+set_rr_weight(vector strvec, void *ptr, const char *file, int line_nr)
e65fa3
 {
e65fa3
 	int *int_ptr = (int *)ptr;
e65fa3
 	char * buff;
e65fa3
@@ -1025,7 +1039,7 @@ declare_mp_handler(rr_weight, set_rr_weight)
e65fa3
 declare_mp_snprint(rr_weight, print_rr_weight)
e65fa3
 
e65fa3
 static int
e65fa3
-set_pgfailback(vector strvec, void *ptr)
e65fa3
+set_pgfailback(vector strvec, void *ptr, const char *file, int line_nr)
e65fa3
 {
e65fa3
 	int *int_ptr = (int *)ptr;
e65fa3
 	char * buff;
e65fa3
@@ -1075,7 +1089,7 @@ declare_mp_handler(pgfailback, set_pgfailback)
e65fa3
 declare_mp_snprint(pgfailback, print_pgfailback)
e65fa3
 
e65fa3
 static int
e65fa3
-no_path_retry_helper(vector strvec, void *ptr)
e65fa3
+no_path_retry_helper(vector strvec, void *ptr, const char *file, int line_nr)
e65fa3
 {
e65fa3
 	int *int_ptr = (int *)ptr;
e65fa3
 	char * buff;
e65fa3
@@ -1120,7 +1134,8 @@ declare_mp_handler(no_path_retry, no_path_retry_helper)
e65fa3
 declare_mp_snprint(no_path_retry, print_no_path_retry)
e65fa3
 
e65fa3
 static int
e65fa3
-def_log_checker_err_handler(struct config *conf, vector strvec)
e65fa3
+def_log_checker_err_handler(struct config *conf, vector strvec,
e65fa3
+			    const char *file, int line_nr)
e65fa3
 {
e65fa3
 	char * buff;
e65fa3
 
e65fa3
@@ -1193,7 +1208,8 @@ print_reservation_key(struct strbuf *buff,
e65fa3
 }
e65fa3
 
e65fa3
 static int
e65fa3
-def_reservation_key_handler(struct config *conf, vector strvec)
e65fa3
+def_reservation_key_handler(struct config *conf, vector strvec,
e65fa3
+			    const char *file, int line_nr)
e65fa3
 {
e65fa3
 	return set_reservation_key(strvec, &conf->reservation_key,
e65fa3
 				   &conf->sa_flags,
e65fa3
@@ -1209,7 +1225,8 @@ snprint_def_reservation_key (struct config *conf, struct strbuf *buff,
e65fa3
 }
e65fa3
 
e65fa3
 static int
e65fa3
-mp_reservation_key_handler(struct config *conf, vector strvec)
e65fa3
+mp_reservation_key_handler(struct config *conf, vector strvec, const char *file,
e65fa3
+			   int line_nr)
e65fa3
 {
e65fa3
 	struct mpentry * mpe = VECTOR_LAST_SLOT(conf->mptable);
e65fa3
 	if (!mpe)
e65fa3
@@ -1229,7 +1246,7 @@ snprint_mp_reservation_key (struct config *conf, struct strbuf *buff,
e65fa3
 }
e65fa3
 
e65fa3
 static int
e65fa3
-set_off_int_undef(vector strvec, void *ptr)
e65fa3
+set_off_int_undef(vector strvec, void *ptr, const char *file, int line_nr)
e65fa3
 {
e65fa3
 	int *int_ptr = (int *)ptr;
e65fa3
 	char * buff;
e65fa3
@@ -1370,7 +1387,8 @@ declare_hw_snprint(recheck_wwid, print_yes_no_undef)
e65fa3
 
e65fa3
 
e65fa3
 static int
e65fa3
-def_uxsock_timeout_handler(struct config *conf, vector strvec)
e65fa3
+def_uxsock_timeout_handler(struct config *conf, vector strvec, const char *file,
e65fa3
+			   int line_nr)
e65fa3
 {
e65fa3
 	unsigned int uxsock_timeout;
e65fa3
 	char *buff;
e65fa3
@@ -1390,7 +1408,8 @@ def_uxsock_timeout_handler(struct config *conf, vector strvec)
e65fa3
 }
e65fa3
 
e65fa3
 static int
e65fa3
-hw_vpd_vendor_handler(struct config *conf, vector strvec)
e65fa3
+hw_vpd_vendor_handler(struct config *conf, vector strvec, const char *file,
e65fa3
+		      int line_nr)
e65fa3
 {
e65fa3
 	int i;
e65fa3
 	char *buff;
e65fa3
@@ -1430,7 +1449,8 @@ snprint_hw_vpd_vendor(struct config *conf, struct strbuf *buff,
e65fa3
  * blacklist block handlers
e65fa3
  */
e65fa3
 static int
e65fa3
-blacklist_handler(struct config *conf, vector strvec)
e65fa3
+blacklist_handler(struct config *conf, vector strvec, const char*file,
e65fa3
+		  int line_nr)
e65fa3
 {
e65fa3
 	if (!conf->blist_devnode)
e65fa3
 		conf->blist_devnode = vector_alloc();
e65fa3
@@ -1452,7 +1472,8 @@ blacklist_handler(struct config *conf, vector strvec)
e65fa3
 }
e65fa3
 
e65fa3
 static int
e65fa3
-blacklist_exceptions_handler(struct config *conf, vector strvec)
e65fa3
+blacklist_exceptions_handler(struct config *conf, vector strvec,
e65fa3
+			     const char *file, int line_nr)
e65fa3
 {
e65fa3
 	if (!conf->elist_devnode)
e65fa3
 		conf->elist_devnode = vector_alloc();
e65fa3
@@ -1475,7 +1496,8 @@ blacklist_exceptions_handler(struct config *conf, vector strvec)
e65fa3
 
e65fa3
 #define declare_ble_handler(option)					\
e65fa3
 static int								\
e65fa3
-ble_ ## option ## _handler (struct config *conf, vector strvec)		\
e65fa3
+ble_ ## option ## _handler (struct config *conf, vector strvec,		\
e65fa3
+			    const char *file, int line_nr)		\
e65fa3
 {									\
e65fa3
 	char *buff;							\
e65fa3
 	int rc;								\
e65fa3
@@ -1494,7 +1516,8 @@ ble_ ## option ## _handler (struct config *conf, vector strvec)		\
e65fa3
 
e65fa3
 #define declare_ble_device_handler(name, option, vend, prod)		\
e65fa3
 static int								\
e65fa3
-ble_ ## option ## _ ## name ## _handler (struct config *conf, vector strvec) \
e65fa3
+ble_ ## option ## _ ## name ## _handler (struct config *conf, vector strvec, \
e65fa3
+					 const char *file, int line_nr)	\
e65fa3
 {									\
e65fa3
 	char * buff;							\
e65fa3
 	int rc;								\
e65fa3
@@ -1536,13 +1559,15 @@ snprint_ble_simple (struct config *conf, struct strbuf *buff, const void *data)
e65fa3
 }
e65fa3
 
e65fa3
 static int
e65fa3
-ble_device_handler(struct config *conf, vector strvec)
e65fa3
+ble_device_handler(struct config *conf, vector strvec, const char *file,
e65fa3
+		   int line_nr)
e65fa3
 {
e65fa3
 	return alloc_ble_device(conf->blist_device);
e65fa3
 }
e65fa3
 
e65fa3
 static int
e65fa3
-ble_except_device_handler(struct config *conf, vector strvec)
e65fa3
+ble_except_device_handler(struct config *conf, vector strvec, const char *file,
e65fa3
+			  int line_nr)
e65fa3
 {
e65fa3
 	return alloc_ble_device(conf->elist_device);
e65fa3
 }
e65fa3
@@ -1574,7 +1599,8 @@ static int snprint_bled_product(struct config *conf, struct strbuf *buff,
e65fa3
  * devices block handlers
e65fa3
  */
e65fa3
 static int
e65fa3
-devices_handler(struct config *conf, vector strvec)
e65fa3
+devices_handler(struct config *conf, vector strvec, const char *file,
e65fa3
+		int line_nr)
e65fa3
 {
e65fa3
 	if (!conf->hwtable)
e65fa3
 		conf->hwtable = vector_alloc();
e65fa3
@@ -1586,7 +1612,8 @@ devices_handler(struct config *conf, vector strvec)
e65fa3
 }
e65fa3
 
e65fa3
 static int
e65fa3
-device_handler(struct config *conf, vector strvec)
e65fa3
+device_handler(struct config *conf, vector strvec, const char *file,
e65fa3
+	       int line_nr)
e65fa3
 {
e65fa3
 	struct hwentry * hwe;
e65fa3
 
e65fa3
@@ -1623,7 +1650,8 @@ declare_hw_snprint(hwhandler, print_str)
e65fa3
  * overrides handlers
e65fa3
  */
e65fa3
 static int
e65fa3
-overrides_handler(struct config *conf, vector strvec)
e65fa3
+overrides_handler(struct config *conf, vector strvec, const char *file,
e65fa3
+		  int line_nr)
e65fa3
 {
e65fa3
 	if (!conf->overrides)
e65fa3
 		conf->overrides = alloc_hwe();
e65fa3
@@ -1640,7 +1668,8 @@ overrides_handler(struct config *conf, vector strvec)
e65fa3
  * multipaths block handlers
e65fa3
  */
e65fa3
 static int
e65fa3
-multipaths_handler(struct config *conf, vector strvec)
e65fa3
+multipaths_handler(struct config *conf, vector strvec, const char *file,
e65fa3
+		   int line_nr)
e65fa3
 {
e65fa3
 	if (!conf->mptable)
e65fa3
 		conf->mptable = vector_alloc();
e65fa3
@@ -1652,7 +1681,8 @@ multipaths_handler(struct config *conf, vector strvec)
e65fa3
 }
e65fa3
 
e65fa3
 static int
e65fa3
-multipath_handler(struct config *conf, vector strvec)
e65fa3
+multipath_handler(struct config *conf, vector strvec, const char *file,
e65fa3
+		  int line_nr)
e65fa3
 {
e65fa3
 	struct mpentry * mpe;
e65fa3
 
e65fa3
@@ -1681,7 +1711,8 @@ declare_mp_snprint(alias, print_str)
e65fa3
  */
e65fa3
 
e65fa3
 static int
e65fa3
-deprecated_handler(struct config *conf, vector strvec)
e65fa3
+deprecated_handler(struct config *conf, vector strvec, const char *file,
e65fa3
+		   int line_nr)
e65fa3
 {
e65fa3
 	char * buff;
e65fa3
 
e65fa3
diff --git a/libmultipath/parser.c b/libmultipath/parser.c
e65fa3
index d5595fb0..68262d0e 100644
e65fa3
--- a/libmultipath/parser.c
e65fa3
+++ b/libmultipath/parser.c
e65fa3
@@ -558,7 +558,8 @@ process_stream(struct config *conf, FILE *stream, vector keywords,
e65fa3
 						goto out;
e65fa3
 				}
e65fa3
 				if (keyword->handler) {
e65fa3
-				    t = keyword->handler(conf, strvec);
e65fa3
+				    t = keyword->handler(conf, strvec, file,
e65fa3
+							 line_nr);
e65fa3
 					r += t;
e65fa3
 					if (t)
e65fa3
 						condlog(1, "%s line %d, parsing failed: %s",
e65fa3
diff --git a/libmultipath/parser.h b/libmultipath/parser.h
e65fa3
index 3452bde1..11ea2278 100644
e65fa3
--- a/libmultipath/parser.h
e65fa3
+++ b/libmultipath/parser.h
e65fa3
@@ -43,7 +43,7 @@ struct strbuf;
e65fa3
 
e65fa3
 /* keyword definition */
e65fa3
 typedef int print_fn(struct config *, struct strbuf *, const void *);
e65fa3
-typedef int handler_fn(struct config *, vector);
e65fa3
+typedef int handler_fn(struct config *, vector, const char *file, int line_nr);
e65fa3
 
e65fa3
 struct keyword {
e65fa3
 	char *string;