module-setup: suppress the early iscsi error messages

Currently, we throw the error message at the very beginning, as
a result on a pure-hardware(all-offload) iscsi machine with many
iscsi partitions, we suffered from too much noise as follows:
  iscsiadm: No records found
  Unable to find iscsi record for
  /sys/devices/pci0000:00/0000:00:06.0/0000:07:00.0/0000:08:01.1/host0/session1
  iscsiadm: No records found
  Unable to find iscsi record for
  /sys/devices/pci0000:00/0000:00:06.0/0000:07:00.0/0000:08:01.3/host1/session2
  iscsiadm: No records found
  Unable to find iscsi record for
  /sys/devices/pci0000:00/0000:00:06.0/0000:07:00.0/0000:08:01.1/host0/session1
  iscsiadm: No records found
  Unable to find iscsi record for
  /sys/devices/pci0000:00/0000:00:06.0/0000:07:00.0/0000:08:01.3/host1/session2
  iscsiadm: No records found
  Unable to find iscsi record for
  /sys/devices/pci0000:00/0000:00:06.0/0000:07:00.0/0000:08:01.1/host0/session1
  iscsiadm: No records found
  Unable to find iscsi record for
  /sys/devices/pci0000:00/0000:00:06.0/0000:07:00.0/0000:08:01.3/host1/session2
  iscsiadm: No records found
  Unable to find iscsi record for
  /sys/devices/pci0000:00/0000:00:06.0/0000:07:00.0/0000:08:01.1/host0/session1
  iscsiadm: No records found
  Unable to find iscsi record for
  /sys/devices/pci0000:00/0000:00:06.0/0000:07:00.0/0000:08:01.3/host1/session2
  iscsiadm: No records found
  Unable to find iscsi record for
  /sys/devices/pci0000:00/0000:00:06.0/0000:07:00.0/0000:08:01.1/host0/session1
  iscsiadm: No records found
  Unable to find iscsi record for
  /sys/devices/pci0000:00/0000:00:06.0/0000:07:00.0/0000:08:01.3/host1/session2
  kexec: loaded kdump kernel
  Starting kdump: [OK]

There's no need to know the very early error messages, we can
remove the error output which is actually normal for the pure
hardware iscsi.

As for unexpected errors, we kept the error outputs in the
succeeding kdump_iscsi_get_rec_val() calls by not appending
"2>/dev/null".

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
This commit is contained in:
Xunlei Pang 2017-07-24 21:31:39 +08:00 committed by Dave Young
parent 2777a93a9c
commit 38e6b41c0c

View File

@ -545,11 +545,9 @@ kdump_setup_iscsi_device() {
dinfo "Found iscsi component $1" dinfo "Found iscsi component $1"
# Check once before getting explicit values, so we can output a decent # Check once before getting explicit values, so we can bail out early,
# error message. # e.g. in case of pure-hardware(all-offload) iscsi.
if ! /sbin/iscsiadm -m session -r ${path} &>/dev/null ; then
if ! /sbin/iscsiadm -m session -r ${path} >/dev/null ; then
derror "Unable to find iscsi record for $path"
return 1 return 1
fi fi