[blivet][rhel7-branch] Make sure to add hyperPAV aliases to dasd.conf (#1031589)
Brian C. Lane
bcl at redhat.com
Mon Jun 15 16:27:45 UTC 2015
On Thu, Jun 11, 2015 at 12:06:12PM -0400, Samantha N. Bueno wrote:
> HyperPAV aliases enable improved I/O efficiency by allowing parallel
> access to a real DASD through a base subchannel (device) and multiple
> aliases.
>
> Unfortunately, while the kernel recognizes such devices, they don't
> seem to generate any actual udev events so that blivet picks them up;
> nor do these aliases have a device node. Thus, if they are used at all
> during installation, they are not brought online after rebooting, since
> they are on the device ignore list. They are not removed from the device
> ignore list since there is no entry in dasd.conf, so this patch loops
> through all DASD devices in sysfs and adds all detected aliases to dasd.conf.
>
> Resolves: rhbz#1031589
> ---
> blivet/devicelibs/dasd.py | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/blivet/devicelibs/dasd.py b/blivet/devicelibs/dasd.py
> index 73284e8..cf00b55 100644
> --- a/blivet/devicelibs/dasd.py
> +++ b/blivet/devicelibs/dasd.py
> @@ -184,3 +184,18 @@ def write_dasd_conf(disks, root):
> for dasd in sorted(disks, key=lambda d: d.name):
> fields = [dasd.busid] + dasd.getOpts()
> f.write("%s\n" % " ".join(fields),)
> +
> + # check for hyper PAV aliases; they need to get added to dasd.conf as well
> + sysfs = "/sys/bus/ccw/drivers/dasd-eckd"
> + # this does catch every DASD, even non-aliases, but we're only going to be
> + # checking for a very specific flag, so there won't be any duplicate entries
> + # in dasd.conf
> + devs = [d for d in os.listdir(sysfs) if d.startswith("0.0")]
> + with open(os.path.realpath(root + "/etc/dasd.conf"), "a") as f:
> + for d in devs:
> + aliasfile = "%s/%s/alias" % (sysfs, d)
Is it safe to assume the alias file will always be present?
> + with open(aliasfile, "r") as falias:
> + alias = falias.read().strip()
What's in alias? Maybe a comment about the conditions that need to be
met would be good here (eg. alias present and contains anything).
> +
> + if alias:
> + f.write("%s\n" % d)
> --
> 1.9.3
>
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
More information about the anaconda-patches
mailing list