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

Nageswara R Sastry rnsastry at linux.vnet.ibm.com
Mon Jun 10 10:33:47 UTC 2013


In my view the following changes are required to support installation on FBA
disks. For each comment explained why that particular approach has been
chosen and request that please suggest if there is any better approach.

 >> 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 should really not require _any_ special code in blivet unless to
 >add support for a new disklabel type. I have several comments, below.

With in the 'dasd' disklabel type, FBA disk is having special 
characteristics
like 'maxPrimaryPartitionCount' is '1' and having implicit partition. Some
extra code is required to support FBA disk and to differentiate normal DASD
and FBA disk.

 >> Patches originally submitted by Nageswara R Sastry
 >> <rnsastry at linux.vnet.ibm.com>; I only refactored them as needed 
to mesh
 >> with current code since they were written last year.
 >> ---
 >>  blivet/__init__.py          |  7 +++++--
 >>  blivet/devices.py           | 17 +++++++++--------
 >>  blivet/formats/disklabel.py | 23 ++++++++++++++++++++++-
 >>  blivet/partitioning.py      |  2 ++
 >>  4 files changed, 38 insertions(+), 11 deletions(-)
 >>
 >>
 >> -        if disk.partitioned and disk.format.partitions:
 >> -            raise ValueError("cannot initialize a disk that has 
partitions")
 >> +        log.debug("Checking to see if device is LDL DASD")
 >> +        if not disk.format.isLDL():
 >> +            log.debug("Disk is not LDL DASD")
 >> +            if disk.partitioned and disk.format.partitions:
 >> +                raise ValueError("cannot initialize a disk that has 
partitions")
 >
 >I don't want the logs littered with strings about LDL DASD when 99.8% of
 >the user-base doesn't know or care what that is. If there must be
 >anything in the logs about these it should be only when we see one.

Agree, The above two log.debug statements can be removed.

 >> --- a/blivet/devices.py
 >> +++ b/blivet/devices.py
 >> @@ -1484,15 +1484,16 @@ class PartitionDevice(StorageDevice):
 >>      def _create(self):
 >>          """ Create the device. """
 >>          log_method_call(self, self.name, status=self.status)
 >> -  self.disk.format.addPartition(self.partedPartition)
 >> +        # Do not create partition on LDL formatted
 >> +        if not self.disk.format.isLDL():
 >> +  self.disk.format.addPartition(self.partedPartition)
 >
 >So, what -- we're just going to silently not add a partition we have
 >already planned to add? This isn't right.

FBA disks already have implicit partition and adding a new partition is not
possible.

 >> @@ -165,7 +178,13 @@ 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"):
 >> +  self._partedDisk = self.newPartedDisk()
 >> +  # Don't want to break for the normal DASD
 >> +  if self._partedDisk.maxPrimaryPartitionCount != 1:
 >> +      self._partedDisk = self.freshPartedDisk()
 >> +                else:
 >> +  self.partedDisk = self.freshPartedDisk()
 >
 >Why does this special type of DASD require the use of newDisk instead of
 >freshDisk, which works for every other disk type?

'ped_disk_new' function first does 'disk_probe' and calls function named
'ped_disk_new_fresh'.

'ped_disk_new_fresh' function starts creating disk according to the supplied
'disk_label'.

FBA disks first need a 'disk_probe' to get the correct meta-data assigned.
After the correct assignment of meta-data 'ped_disk_new_fresh' function 
works
fine.

 > works for every other disk type?
no, it won't work for every other disk type that is the reason why it was
separated for FBA

 >> --- a/blivet/partitioning.py
 >> +++ b/blivet/partitioning.py
 >> @@ -425,6 +425,8 @@ def getNextPartitionType(disk, no_primary=None):
 >>                  part_type = parted.PARTITION_LOGICAL
 >>      elif extended and logical_count < max_logicals:
 >>          part_type = parted.PARTITION_LOGICAL
 >> +    elif (disk.type == "dasd" and disk.maxPrimaryPartitionCount == 1):
 >> +        part_type = parted.PARTITION_NORMAL
 >
 >Is this really necessary? If these disks have special requirements
 >and/or limitations they should have code in parted (if not a new
 >disklabel type) to convey these instead of junking up blivet with all
 >this special-case code.

This condition was taken care in 'parted' tool. But 'getNextPartitionType'
function is not returning the correct partition type for FBA disk 
because this
kind of disk is not known to it. So added a condition to return the correct
partition type.
 >
 >>
 >>      return part_type
 >>

Regards
Nageswara R Sastry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fedorahosted.org/pipermail/anaconda-patches/attachments/20130610/e03afca3/attachment.html>


More information about the anaconda-patches mailing list