Re: [PATCH] Use addUdevPartitionDevice() for adding dmraid / multipath partitions (#527785)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2009-10-08 at 14:45 +0200, Hans de Goede wrote:
> With a kickstart install, with "clearpart --label", we will end up
> scanning pre-existing partitions after clearing the label. This leads
> to the backtrace as seen in #527785 and #526517.
> 
> addUdevPartitionDevice() has special handling for this case, instead of
> copy and pasting this, this patch modifies addUdevPartitionDevice() so
> that it can be used for dmraid and multipath partitions too.
> ---
>  storage/devicetree.py |   23 +++++++----------------
>  1 files changed, 7 insertions(+), 16 deletions(-)

Looks good.

> 
> diff --git a/storage/devicetree.py b/storage/devicetree.py
> index cce8013..6df57cf 100644
> --- a/storage/devicetree.py
> +++ b/storage/devicetree.py
> @@ -1032,21 +1032,11 @@ class DeviceTree(object):
>                  if udev_device_is_multipath_partition(info, self):
>                      diskname = udev_device_get_multipath_partition_disk(info)
>                      disk = self.getDeviceByName(diskname)
> -                    device = PartitionDevice(name, sysfsPath=sysfs_path,
> -                                             major=udev_device_get_major(info),
> -                                             minor=udev_device_get_minor(info),
> -                                             exists=True, parents=[disk])
> +                    return self.addUdevPartitionDevice(info, disk=disk)
>                  elif udev_device_is_dmraid_partition(info, self):
>                      diskname = udev_device_get_dmraid_partition_disk(info)
>                      disk = self.getDeviceByName(diskname)
> -                    device = PartitionDevice(name, sysfsPath=sysfs_path,
> -                                             major=udev_device_get_major(info),
> -                                             minor=udev_device_get_minor(info),
> -                                             exists=True, parents=[disk])
> -                if not device is None:
> -                    # DWL FIXME: call self.addUdevPartitionDevice here instead
> -                    self._addDevice(device)
> -
> +                    return self.addUdevPartitionDevice(info, disk=disk)
>  
>              # if we get here, we found all of the slave devices and
>              # something must be wrong -- if all of the slaves are in
> @@ -1114,16 +1104,17 @@ class DeviceTree(object):
>  
>          return device
>  
> -    def addUdevPartitionDevice(self, info):
> +    def addUdevPartitionDevice(self, info, disk=None):
>          name = udev_device_get_name(info)
>          log_method_call(self, name=name)
>          uuid = udev_device_get_uuid(info)
>          sysfs_path = udev_device_get_sysfs_path(info)
>          device = None
>  
> -        disk_name = os.path.basename(os.path.dirname(sysfs_path))
> -        disk_name = disk_name.replace('!','/')
> -        disk = self.getDeviceByName(disk_name)
> +        if disk is None:
> +            disk_name = os.path.basename(os.path.dirname(sysfs_path))
> +            disk_name = disk_name.replace('!','/')
> +            disk = self.getDeviceByName(disk_name)
>  
>          if disk is None:
>              # create a device instance for the disk

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux