[PATCH V5][blivet] Add support for FBA EDEV/EAV installation (#885957)

David Lehman dlehman at redhat.com
Thu Oct 31 15:57:54 UTC 2013


On Thu, 2013-10-31 at 15:52 +0530, Nageswara R Sastry wrote:
> Hello,
> 
> Because of the changes done to parted code some part of the v4
> patch becomes obsolete. So removed that code and created a new
> version 5 patch.
> 
> Regards
> R.Nageswara Sastry
> 
> 
> Subject: [PATCH v5] storage: add support for EDEV device
> 
> From: Nageswara R Sastry <rnsastry at linux.vnet.ibm.com>
> 
> Fixed Block Access (FBA) DASDs are mainframe-specific disk devices
> which are layed out as a sequence of 512-byte sectors. In contrast
> to ECKD DASDs, these disks do not require formatting and resemble
> the LBA layout of non-mainframe disks. Despite this resemblance,
> the Linux kernel applies special handling during partition detection
> for FBA DASDs, resulting in a single, immutable partition being
> reported.
> 
> While actual FBA DASD hardware is no longer available, the z/VM
> hypervisor can simulate FBA DASD disks, backed by either ECKD or
> SCSI devices.
> 
> This patch adds support for successful installation on FBA DASD
> devices (EDEV)
> 
> This version (v5) of the patch contains the code customized for
> blivet and changed logic to minimize effecting other code paths
> and effects only System z related code.
> 
> Signed-off-by: Nageswara R Sastry <rnsastry at linux.vnet.ibm.com>
> ---
>  blivet/__init__.py          |    5 ++++-
>  blivet/devices.py           |   10 +++++++++-
>  blivet/formats/disklabel.py |   18 +++++++++++++++++-
>  3 files changed, 30 insertions(+), 3 deletions(-)
> 
> --- a/blivet/__init__.py
> +++ b/blivet/__init__.py
> @@ -807,7 +807,10 @@ class Blivet(object):
>                          self.devicetree._removeDevice(part, moddisk=False)
> 
>          if disk.partitioned and disk.format.partitions:
> -            raise ValueError("cannot initialize a disk that has partitions")
> +            if disk.format.isLDL:
> +                pass
> +            else:
> +                raise ValueError("cannot initialize a disk that has partitions")

In this case will the partition be listed by udev or
in /proc/partitions? If so, you should be using the block just above
this whose entire purpose is to handle disklabels with magic/special
partitions.

> 
>          # remove existing formatting from the disk
>          destroy_action = ActionDestroyFormat(disk)
> --- a/blivet/devices.py
> +++ b/blivet/devices.py
> @@ -94,6 +94,7 @@
>  """
> 
>  import os
> +import sys
>  import math
>  import copy
>  import pprint
> @@ -1503,7 +1504,14 @@ class PartitionDevice(StorageDevice):
>      def _create(self):
>          """ Create the device. """
>          log_method_call(self, self.name, status=self.status)
> -        self.disk.format.addPartition(self.partedPartition)
> +        try:
> +            self.disk.format.addPartition(self.partedPartition)
> +        except Exception as e:
> +            if self.disk.format.isLDL:
> +                log.debug("Skipping add partition for FBA disk")
> +                sys.exc_clear()
> +            else:
> +                raise DeviceCreateError(str(e), self.name)

As I said before, the above chunk is not acceptable. If it is not
possible to add partitions on LDL disks it will not get to this point.
The code in partitioning.py will not succeed in allocating partitions
from these devices any more than this code will.

> 
>          self._wipe()
>          try:
> --- a/blivet/formats/disklabel.py
> +++ b/blivet/formats/disklabel.py
> @@ -145,6 +145,13 @@ class DiskLabel(DeviceFormat):
>          return parted.freshDisk(device=self.partedDevice, ty=self._labelType)
> 
>      @property
> +    def isLDL(self):
> +        """ Return True for LDL formatted disk. """
> +        log_method_call(self, device=self.device)
> +        return (self._labelType == "dasd" and
> +                self.partedDisk.maxPrimaryPartitionCount == 1)
> +
> +    @property
>      def partedDisk(self):
>          if not self._partedDisk:
>              if self.exists:
> @@ -165,7 +172,14 @@ class DiskLabel(DeviceFormat):
>                  # preexisting disklabels if the passed type was wrong
>                  self._labelType = self._partedDisk.type
>              else:
> -                self._partedDisk = self.freshPartedDisk()
> +                if (self._labelType == "dasd"):
> +                    # FBA need to handle differently
> +                    self._partedDisk = parted.newDisk(self.partedDevice)
> +                    # Do not want to break for DASD
> +                    if self._partedDisk.maxPrimaryPartitionCount != 1:

Why not use isLDL above? Either use it everywhere or remove it and use
the longhand notation everywhere.

> +                        self._partedDisk = self.freshPartedDisk()
> +                else:
> +                    self._partedDisk = self.freshPartedDisk()
> 
>              # turn off cylinder alignment
>              if self._partedDisk.isFlagAvailable(parted.DISK_CYLINDER_ALIGNMENT):
> @@ -442,6 +456,8 @@ class DiskLabel(DeviceFormat):
>              return 1
>          elif self.labelType == "sun":
>              return 3
> +        elif self.isLDL:
> +            return 1
>          else:
>              return 0
> 
> 




More information about the anaconda-patches mailing list