public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Steffen Maier <maier@linux.ibm.com>
To: git-commits@fedoraproject.org
Subject: [rpms/s390utils] f44: zfcp: migrate to consolidated persistent device config with zdev (#1937046,#1937048)
Date: Wed, 05 Aug 2026 09:17:00 GMT	[thread overview]
Message-ID: <178592142004.1.5760458501226157380.rpms-s390utils-91f46d3bfcab@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/s390utils
            Branch : f44
            Commit : 91f46d3bfcab50fb31c605da0e3af796b74d41c6
            Author : Steffen Maier <maier@linux.ibm.com>
            Date   : 2026-05-26T12:57:23+02:00
            Stats  : +51/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/s390utils/c/91f46d3bfcab50fb31c605da0e3af796b74d41c6?branch=f44

            Log:
            zfcp: migrate to consolidated persistent device config with zdev (#1937046,#1937048)

Implements the zfcp part of referenced bugs.

This also fixes real customer problems with Live Guest Relocation under
z/VM SSI, where the destination has vHBAs with different device bus-IDs.
56-zfcp.rules only triggers on initialization of the zfcp device driver.
Even though users had persistently configured vHBAs (with full zfcp paths)
in /etc/zfcp.conf, it could not automatically activate the vHBAs on the
destination after relocation and thus lost all paths.
Zdev persistent config udev rules selectively trigger on hotplug of
vHBA devices (and of FC remote ports).

The new script zfcpconfmigrate.sh needs to be called at an appropriate time
during distribution upgrade. If /etc/zfcp.conf exists, it automatically
migrates /etc/zfcp.conf to zdev persistent config and moves the old
zfcp.conf to a backup file. To prevent overwriting potentially existing
backups of the old persistent configuration, simply use a timestamp so we
don't overwrite old migration backups.

Signed-off-by: Steffen Maier <maier@linux.ibm.com>

---
diff --git a/s390utils.spec b/s390utils.spec
index b360b8a..25d8e3e 100644
--- a/s390utils.spec
+++ b/s390utils.spec
@@ -64,6 +64,8 @@ Source21:       https://fedorapeople.org/cgit/sharkcz/public_git/utils.git/tree/
 Source23:       20-zipl-kernel.install
 Source24:       52-zipl-rescue.install
 Source25:       91-zipl.install
+Source26:       https://fedorapeople.org/cgit/sharkcz/public_git/utils.git/tree/zfcpconfmigrate.sh
+
 
 %if %{with signzipl}
 %define pesign_name redhatsecureboot302
@@ -212,6 +214,7 @@ mv %{buildroot}%{_datadir}/s390-tools/netboot/mk-s390image.1 %{buildroot}%{_mand
 mkdir -p %{buildroot}{/boot,%{_udevrulesdir},%{_sysconfdir}/{profile.d,sysconfig},%{_prefix}/lib/modules-load.d}
 install -p -m 644 zipl/boot/tape0.bin %{buildroot}/boot/tape0
 install -p -m 755 %{SOURCE5} %{buildroot}%{_sbindir}
+install -p -m 755 %{SOURCE26} %{buildroot}%{_sbindir}
 install -p -m 755 %{SOURCE13} %{buildroot}%{_sbindir}
 install -p -m 755 %{SOURCE21} %{buildroot}%{_sbindir}
 install -p -m 644 %{SOURCE7} %{buildroot}%{_udevrulesdir}/56-zfcp.rules
@@ -403,6 +406,7 @@ This package provides minimal set of tools needed to system to boot.
 %{_sbindir}/dasdconf.sh
 %{_sbindir}/normalize_dasd_arg
 %{_sbindir}/zfcpconf.sh
+%{_sbindir}/zfcpconfmigrate.sh
 %{_sbindir}/device_cio_free
 %{_sbindir}/dasd_cio_free
 %{_sbindir}/zfcp_cio_free

diff --git a/zfcpconfmigrate.sh b/zfcpconfmigrate.sh
new file mode 100644
index 0000000..2a3d850
--- /dev/null
+++ b/zfcpconfmigrate.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+# SPDX-License-Identifier: MIT
+# Copyright IBM Corp. 2023
+
+# This is just a wrapper to migrate old /etc/zfcp.conf to the new
+# consolidated persistent configuration of s390 devices with chzdev.
+
+CONFIG=/etc/zfcp.conf
+PATH=/bin:/sbin
+
+DATE=$(date --iso-8601=seconds)
+PREFIX="${CONFIG}.${DATE}.migrated-to-chzdev"
+
+if [ -f "$CONFIG" ]; then
+    # show migration output to users and log it into file
+    exec > >(tee "${PREFIX}.log") 2>&1
+    sed 'y/ABCDEF/abcdef/' < $CONFIG | while read -r line; do
+       case $line in
+	   \#*) ;;
+	   *)
+	       [ -z "$line" ] && continue
+	       # shellcheck disable=SC2086
+	       set -- $line
+	       if [ $# -eq 1 ]; then
+		   DEVICE=${1##*0x}
+		   chzdev --enable --persistent zfcp-host "$DEVICE" --yes --no-root-update --force --no-settle
+		   continue
+	       fi
+	       if [ $# -eq 5 ]; then
+		   DEVICE=$1
+		   #SCSIID=$2
+		   WWPN=$3
+		   #SCSILUN=$4
+		   FCPLUN=$5
+	       elif [ $# -eq 3 ]; then
+		   DEVICE=${1##*0x}
+		   WWPN=$2
+		   FCPLUN=$3
+	       fi
+	       chzdev --enable --persistent zfcp-lun "$DEVICE:$WWPN:$FCPLUN" --yes --no-root-update --force --no-settle
+	       ;;
+       esac
+   done
+   mv "$CONFIG" "$PREFIX"
+   echo "zfcpconfmigrate.sh: Information: Your persistent zfcp device configuration file $CONFIG was migrated to the new consolidated mechanism. From now on, please use lszdev and chzdev from s390utils instead. To finally complete the migration, please run: kdumpctl rebuild; systemctl restart kdump; dracut -f; zipl"
+fi

                 reply	other threads:[~2026-08-05  9:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178592142004.1.5760458501226157380.rpms-s390utils-91f46d3bfcab@fedoraproject.org \
    --to=maier@linux.ibm.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox