Re: [PATCH] Remove /sys prefix in udev_enumerate_devices()

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

So this patch actually takes s390x back to the original problem.  It's now
hanging when initializing the Network object, which when I traced it came down
to udev_get_device() hanging.

I can't confirm, but it looks like this problem is also affecting ppc64.

I do not know why this keeps going back and forth, but the pyudev.py code
looks to be the main cause.

This is blocking RHEL-6, so we need to get this figured out quickly.

On Fri, 29 Jan 2010, Martin Gracik wrote:

looks good

--

 Martin Gracik

----- "Hans de Goede" <hdegoede@xxxxxxxxxx> wrote:

The recent base_udev.py changes to switch over to
global_udev.enumerate_devices(), move the removing of the /sys prefix
to
udev_get_device(). But in various places in the devicetree we call
udev_get_device() (through udev_get_block_device) to get information
from
parents which are not yet in the tree (ie when we scan a partition
before its disk).

All these calls are broken now, as all those pass in a path without
/sys
at the front and the new udev_get_device() wants it with /sys in
front.

This patch makes udev_enumerate_devices() return paths without the
/sys
prefix, and reverses the changes to udev_get_device() to expect a full
path,
so that we use sysfs paths without /sys in front consistently
everywhere.
---
 baseudev.py |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/baseudev.py b/baseudev.py
index 5ba1011..7266bc6 100644
--- a/baseudev.py
+++ b/baseudev.py
@@ -31,19 +31,22 @@ import logging
 log = logging.getLogger("storage")

 def udev_enumerate_devices(deviceClass="block"):
-    return global_udev.enumerate_devices(subsystem=deviceClass)
+    devices = global_udev.enumerate_devices(subsystem=deviceClass)
+    return [path[4:] for path in devices]

 def udev_get_device(sysfs_path):
-    if not os.path.exists(sysfs_path):
+    if not os.path.exists("/sys%s" % sysfs_path):
         log.debug("%s does not exist" % sysfs_path)
         return None

-    dev = global_udev.create_device(sysfs_path)
+    # XXX we remove the /sys part when enumerating devices,
+    # so we have to prepend it when creating the device
+    dev = global_udev.create_device("/sys" + sysfs_path)

     if dev:
         dev["name"] = dev.sysname
         dev["symlinks"] = dev["DEVLINKS"]
-        dev["sysfs_path"] = sysfs_path[4:]
+        dev["sysfs_path"] = sysfs_path

         # now add in the contents of the uevent file since they're
handy
         dev = udev_parse_uevent_file(dev)
--
1.6.5.2

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

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


- -- David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAktjaEQACgkQ5hsjjIy1VklBEACguGW8PTu5i38um8gz0wPsq+3n
cKQAoJBvHEmwVgsz19gIybxJBaEDnWp3
=BxKx
-----END 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