From 005e72491277a7747da1f931547ffad50397a052 Mon Sep 17 00:00:00 2001 From: Mark Syms Date: Fri, 8 Nov 2019 10:38:26 +0000 Subject: [PATCH] CP-32433: refine the conditions under which mpath count will trigger Squash noisy logs from checking if mpath is working. Signed-off-by: Mark Syms --- Makefile | 2 +- drivers/mpath_cli.py | 2 -- mk/sm.spec.in | 2 +- udev/40-multipath.rules | 11 ----------- udev/65-multipath.rules | 16 ++++++++++++++++ 5 files changed, 18 insertions(+), 15 deletions(-) delete mode 100644 udev/40-multipath.rules create mode 100644 udev/65-multipath.rules diff --git a/Makefile b/Makefile index d78f29fd6..92e7edc21 100755 --- a/Makefile +++ b/Makefile @@ -64,7 +64,7 @@ SM_LIBS += fcoelib SM_LIBS += constants SM_LIBS += cbtutil -UDEV_RULES = 40-multipath 55-xs-mpath-scsidev 57-usb 58-xapi +UDEV_RULES = 65-multipath 55-xs-mpath-scsidev 57-usb 58-xapi MPATH_DAEMON = sm-multipath MPATH_CONF = multipath.conf SMLOG_CONF = SMlog diff --git a/drivers/mpath_cli.py b/drivers/mpath_cli.py index 5e14b681a..ce04e18e4 100755 --- a/drivers/mpath_cli.py +++ b/drivers/mpath_cli.py @@ -59,10 +59,8 @@ def reconfigure(): def is_working(): cmd="help" - util.SMlog("mpath cmd: %s" % cmd) try: (rc,stdout,stderr) = util.doexec(mpathcmd,cmd) - util.SMlog("mpath output: %s" % stdout) m=regex3.search(stdout) if m: return True diff --git a/mk/sm.spec.in b/mk/sm.spec.in index 35698fbb0..4e52110da 100755 --- a/mk/sm.spec.in +++ b/mk/sm.spec.in @@ -327,7 +327,7 @@ tests/run_python_unittests.sh %{_unitdir}/usb-scan.socket %{_unitdir}/mpathcount.service %{_unitdir}/mpathcount.socket -%config /etc/udev/rules.d/40-multipath.rules +%config /etc/udev/rules.d/65-multipath.rules %config /etc/udev/rules.d/55-xs-mpath-scsidev.rules %config /etc/udev/rules.d/58-xapi.rules %config /etc/multipath.xenserver/multipath.conf diff --git a/udev/40-multipath.rules b/udev/40-multipath.rules deleted file mode 100644 index f78174d66..000000000 --- a/udev/40-multipath.rules +++ /dev/null @@ -1,11 +0,0 @@ -SUBSYSTEM!="block", GOTO="end_mpath" -KERNEL=="nbd*", GOTO="end_mpath" -KERNEL=="td[a-z]*", GOTO="end_mpath" -KERNEL!="dm-*", GOTO="count_mpath" -ACTION=="remove", GOTO="end_mpath" -ACTION=="add|change", PROGRAM=="/bin/bash -c '/sbin/dmsetup info -c -o name --noheadings -j %M -m %m | /bin/grep VG_XenStorage'", GOTO="end_mpath" -ACTION=="add|change", PROGRAM=="/bin/bash -c '/sbin/dmsetup info -c -o name --noheadings -j %M -m %m | /bin/grep XSLocalEXT'", GOTO="end_mpath" -ACTION=="add|change", PROGRAM=="/sbin/dmsetup info -c -o name --noheadings -j %M -m %m", RESULT=="?*", SYMLINK+="disk/by-scsid/%c/mapper" -LABEL="count_mpath" -ACTION=="*", RUN+="/opt/xensource/libexec/kickpipe mpathcount" -LABEL="end_mpath" diff --git a/udev/65-multipath.rules b/udev/65-multipath.rules new file mode 100644 index 000000000..7eb89291a --- /dev/null +++ b/udev/65-multipath.rules @@ -0,0 +1,16 @@ +SUBSYSTEM!="block", GOTO="end_mpath" +KERNEL=="nbd*", GOTO="end_mpath" +KERNEL=="td[a-z]*", GOTO="end_mpath" + +IMPORT{db}="DM_MULTIPATH_DEVICE_PATH" +ACTION=="add", ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="count_mpath" +ACTION=="remove", ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="count_mpath" +IMPORT{db}="DM_ACTION" +ACTION=="change", ENV{DM_ACTION}=="PATH_REINSTATED", GOTO="count_mpath" +ACTION=="change", ENV{DM_ACTION}=="PATH_FAILED", GOTO="count_mpath" +GOTO="end_mpath" + +LABEL="count_mpath" +ACTION=="add|change", PROGRAM=="/sbin/dmsetup info -c -o name --noheadings -j %M -m %m", RESULT=="?*", SYMLINK+="disk/by-scsid/%c/mapper" +ACTION=="*", RUN+="/opt/xensource/libexec/kickpipe mpathcount" +LABEL="end_mpath"