Re: [PATCH] Make all sysfs path's be _without_ /sys prefix (#516168)

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

 



This looks good, and, in my test, everything works fine.
I would go ahead and commit.
On Fri, Aug 07, 2009 at 03:56:05PM +0200, Hans de Goede wrote:
> Most sysfs path handling code expects / uses sysfs path's without the
> /sys prefix (as udev does internally). There were 4 functions which were
> exceptions to this:
> udev_enumerate_devices
> udev_enumerate_block_devices
> udev_get_device
> udev_get_block_device
> 
> These expected resp. returned sysfs path's with /sys prefix. This
> inconsistency causes the backtrace in bug 516168. Rather then applying a
> simple fix for this, this patch makes the sysfs path usage consistent
> everywhere, to avoid issues like this in the future.
> 
...
>          self.setup()
>          udev_settle()
>          self.updateSysfsPath()
> -        info = udev_get_block_device("/sys%s" % self.sysfsPath)
> +        info = udev_get_block_device(self.sysfsPath)
>          self.uuid = udev_device_get_md_uuid(info)
>          for member in self.devices:
>              member.mdUuid = self.uuid
> diff --git a/storage/devicetree.py b/storage/devicetree.py
> index 02fc40e..0dec5e0 100644
> --- a/storage/devicetree.py
> +++ b/storage/devicetree.py
> @@ -972,7 +972,7 @@ class DeviceTree(object):
>                  else:
>                      # we haven't scanned the slave yet, so do it now
>                      path = os.path.normpath("%s/%s" % (dir, slave_name))
> -                    new_info = udev_get_block_device(os.path.realpath(path))
> +                    new_info = udev_get_block_device(os.path.realpath(path)[4:])
>                      if new_info:
>                          self.addUdevDevice(new_info)
>                          if self.getDeviceByName(dev_name) is None:
> @@ -1034,7 +1034,7 @@ class DeviceTree(object):
>              else:
>                  # we haven't scanned the slave yet, so do it now
>                  path = os.path.normpath("%s/%s" % (dir, slave_name))
> -                new_info = udev_get_block_device(os.path.realpath(path))
> +                new_info = udev_get_block_device(os.path.realpath(path)[4:])
>                  if new_info:
>                      self.addUdevDevice(new_info)
>                      if self.getDeviceByName(dev_name) is None:
> @@ -1083,8 +1083,7 @@ class DeviceTree(object):
>  
>          if disk is None:
>              # create a device instance for the disk
> -            path = os.path.dirname(os.path.realpath(sysfs_path))
> -            new_info = udev_get_block_device(path)
> +            new_info = udev_get_block_device(os.path.dirname(sysfs_path))
>              if new_info:
>                  self.addUdevDevice(new_info)
>                  disk = self.getDeviceByName(disk_name)
> -- 
> 1.6.2.2
> 
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

-- 
Joel Andres Granados
Brno, Czech Republic, Red Hat.

Attachment: pgpmiVvsMVKEk.pgp
Description: PGP signature

_______________________________________________
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