summaryrefslogtreecommitdiffstats
path: root/baseudev.py
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2009-12-10 15:39:32 +0100
committerHans de Goede <hdegoede@redhat.com>2009-12-10 20:06:02 +0100
commit75bf0aac951ccd79576d06b5f2c2fa4c30435e4a (patch)
tree5b882cc6429a63fd16c8b2dde993afb2fe040d80 /baseudev.py
parentc33d1d52c66eb6aa7ff8e519aff4b96f311e5d59 (diff)
downloadanaconda-75bf0aac951ccd79576d06b5f2c2fa4c30435e4a.tar.gz
anaconda-75bf0aac951ccd79576d06b5f2c2fa4c30435e4a.tar.xz
anaconda-75bf0aac951ccd79576d06b5f2c2fa4c30435e4a.zip
Rework udev_settle timeout handling (#544177)
1) centralize the setting of the timeout parameter inside the udev_settle function. I do realize that the time needed for initially scanning all disks is much larger, then the time for scanning a single new partition when we are creating partitions. But since this is a timeout, and udevadm settle will exit as soon as the scanning is done, I see no reason not to have a single place to configure the timeout assuming the worst case scenario (the initial disk scan). This way we won't have these magic values sprinkled all over the code. 2) Given that in the past we've had bugs filed about anaconda taking many minutes to scan hardware on big iron machine and that our initial udev settle call will scan all disks, I think that udevadm's default timeout of 1 minutes is too low, so this patch sets the timeout to 5 minutes.
Diffstat (limited to 'baseudev.py')
-rw-r--r--baseudev.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/baseudev.py b/baseudev.py
index d88d7fc41..bda4fd68e 100644
--- a/baseudev.py
+++ b/baseudev.py
@@ -61,7 +61,7 @@ def udev_get_device(sysfs_path):
return dev
def udev_get_devices(deviceClass="block"):
- udev_settle(timeout=30)
+ udev_settle()
entries = []
for path in udev_enumerate_devices(deviceClass):
entry = udev_get_device(path)
@@ -84,10 +84,11 @@ def udev_parse_uevent_file(dev):
return dev
-def udev_settle(timeout=None):
- argv = ["settle"]
- if timeout:
- argv.append("--timeout=%d" % int(timeout))
+def udev_settle():
+ # wait maximal 300 seconds for udev to be done running blkid, lvm,
+ # mdadm etc. This large timeout is needed when running on machines with
+ # lots of disks, or with slow disks
+ argv = ["settle", "--timeout=300"]
iutil.execWithRedirect("udevadm", argv, stderr="/dev/null", searchPath=1)