Commit Graph
127 Commits
Author SHA1 Message Date
Kay Sievers 20bee04c19 libudev: udev_device_get_sysattr_list_entry() update 2011-03-04 23:00:52 +01:00
Kay Sievers d53a3878d2 test-libudev: add short options 2011-03-04 22:56:54 +01:00
Thomas Egerer 95ce1875d7 libudev: use sysfs attr ilist interface for attribute walk
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2011-03-04 21:51:32 +01:00
Thomas Egerer f180ad259f libudev: allow to get list of all available sysfs attrs for a device
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2011-03-04 21:51:03 +01:00
Kay Sievers 0c19cc73da update some comments 2011-02-15 22:28:31 +01:00
Kei Tokunaga c54b43e2c2 udevadm: enumerate - update prev pointer properly
When I tried to boot a system with 256 disks x 4 paths with
device-mapper, udevadm trigger (--type=devices) that was called
from start_udev ended up dumping a core due to a segmentation
fault.

In udev_enumerate_get_list_entry(), if it finds the devices that
should be delayed, it calls syspath_add().  If realloc() in
syspath_add() allocates the required memory at a different memory
address, referring prev->len afterward causes the segmentation
fault.

Signed-off-by: Kei Tokunaga <tokunaga.keiich@jp.fujitsu.com>
2011-02-15 22:28:31 +01:00
Kay Sievers 9c6a11b1c6 libudev: record and export "age" of device record 2010-12-15 08:58:46 +01:00
Kay Sievers 93a724d3f8 libudev: fix renamed device nodes detection logic 2010-12-15 08:58:45 +01:00
Kay Sievers 48a0170b11 libudev: enumerate - allow to filter-out not-already-initialized devices 2010-12-14 14:18:32 +01:00
Kay Sievers ff0e1f4e5d check ifindex > 0 instead of subsystem == "net" 2010-12-14 11:27:02 +01:00
Kay Sievers 14996e80d4 udevd: write full database file for (unsupported) renamed device nodes 2010-12-14 02:30:36 +01:00
Kay Sievers cad40a5fe7 udevd: switch to common id_filename functions 2010-12-12 20:07:15 +01:00
Kay Sievers 24d1076696 udevd: simplify udev database and fix DEVNAME handling 2010-12-11 14:00:46 +01:00
Kay Sievers 4281da1fa6 udevd: use dev_t or netif ifindex as database key
We need to preserve the database of network interfaces while we
rename them. Use the kernel's numbers wherever possible, instead
of the device names.

Fix wrong database filenames which contain a '/', translated
from '!' in the kernel name.

Fix segfault for kobject pathes where the subsystem can not be
determined from sysfs.
2010-12-10 01:18:15 +01:00
Kay Sievers 8ba13ec1cd libudev: do not overwrite path with readlink() call 2010-12-10 01:18:14 +01:00
Kay Sievers cdb1d7608a libudev: return kernel provided devnode when asked before we handled any rules 2010-10-22 13:56:16 +02:00
Kay Sievers fc416258f3 udevd: do not wrongly delay events for devices with swapped names
Renaming network devices might delay events for the other device, which has
the same devpath in the meantime as the original event. Causing a delay until
the timout of the event is reached.

Look at the ifindex/devnum of the devices to check if they are really
the same devices.
2010-10-13 13:08:29 +02:00
Kay Sievers ebd189621f do not rename the database on device rename
Harald Hoyer discovered some incorrect behavior while debugging
problems with network interface renaming:

Udev events might be queued for devices which are renamed. A new
device registered the same time may claime the old name and create
a database entry for it. The current rename logic would move over
this databse entry to the wrong device.
2010-08-11 14:34:32 +02:00
Kay Sievers c11f89b61a fix broken "compile warning fix" 2010-08-10 08:07:28 +02:00
Yin Kangkai ae8011a084 udev: fix compile warning
CC     udev/udevd.o
In file included from udev/udev.h:27,
                 from udev/udevd.c:47:
./libudev/libudev-private.h: In function ‘udev_selinux_setfscreateconat’:
./libudev/libudev-private.h:230: warning: declaration of ‘dirfd’ shadows a global declaration
/usr/include/dirent.h:224: warning: shadowed declaration is here

Signed-off-by: Yin Kangkai <kangkai.yin@intel.com>
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2010-08-08 20:37:37 +02:00
Kay Sievers 8e5a620b17 call util_delete_path() only when we actually deleted stuff 2010-08-03 12:13:53 +02:00
Marco d'Itri 9b6c6b5612 log an error when a message from the wrong version of udevadm is ignored 2010-07-19 10:56:37 +02:00
Kay Sievers 727b12d650 libudev: fix fd leak in udev_enumerate_scan_devices() when tags are searched
Thanks to Lennart for finding this.
2010-06-05 10:30:36 +02:00
Kay Sievers a7d29d1509 libudev: doc - fix typo 2010-05-31 11:18:52 +02:00
Kay Sievers c830e98d6a udevd: read debug settings from kernel commandline 2010-05-28 12:07:27 +02:00
Kay Sievers 87d55ff672 childs -> children 2010-05-27 17:27:56 +02:00
Kay Sievers 88cbfb09ee while (1) -> for (;;) 2010-05-27 15:11:00 +02:00
Kay Sievers e0d9c042f8 libudev: fix udev_queue_get_seqnum_sequence_is_finished() with empty queue file
We an empty or garbage-collected queue file, we might not have a record
for the first sequence we wait for, and therefore must not wait for it.
2010-05-25 12:17:43 +02:00
Kay Sievers cb9a0eeeab udevd: create standard symlinks and handle /lib/udev/devices 2010-05-20 09:04:26 +02:00
Kay Sievers 0c5c48040a libudev: add O_CLOEXEC 2010-05-14 14:52:18 +02:00
Kay Sievers e85f5ec15f reset process priority before executing RUN+=
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581235
2010-05-12 08:46:56 +02:00
Kay Sievers f712894dd4 libudev: add documentation for recently added functions 2010-05-07 23:04:42 +02:00
Kay Sievers 2793f4e34b export udev_device_get_tags_list_entry() 2010-04-23 16:05:38 +02:00
Kay Sievers 2a34f9c31e export tag functions 2010-04-23 10:46:00 +02:00
Kay Sievers 65f099c721 libudev: accept NULL in udev_device_get_tags_list_entry() 2010-04-23 09:22:42 +02:00
Kay Sievers c1dbe11dc3 delete old tags when configuration changes 2010-04-23 09:01:56 +02:00
Kay Sievers bfd88b1d7b fix logic on-demand loading logic for db and uevent 2010-04-22 18:50:43 +02:00
Kay Sievers 28460195c2 add TAG= to improve event filtering and device enumeration 2010-04-22 18:12:36 +02:00
Kay Sievers 60067cc75a more readlink buffer size handling 2010-04-21 14:44:33 +02:00
Kay Sievers a89d342dfb remove "ignore_remove" option 2010-04-13 12:45:38 +02:00
Kay Sievers 1f084fe581 remove "all_partitions" option
We can not predict the major/minor of non-existing devices:
  $ grep . /sys/class/block/sd*/dev
  /sys/class/block/sda1/dev:259:524288
  /sys/class/block/sda2/dev:259:262144
  /sys/class/block/sda3/dev:259:786432
  /sys/class/block/sda4/dev:259:131072
  /sys/class/block/sda/dev:259:0
  /sys/class/block/sdb/dev:259:655360
  /sys/class/block/sdc/dev:259:393216

If this functionality is still needed for some broken hardware, it needs to be
solved with a tool not part of the udev package. Because such option is unreliable
and unsafe to use.
2010-04-13 08:52:48 +02:00
Kay Sievers dbba7e4029 libudev: update documentation 2010-03-25 16:45:48 +01:00
Kay Sievers 23325a66cc add LGPL COPYING to libudev and GUdev 2010-03-18 09:57:44 +01:00
Kay Sievers fc8d61c53d libudev: add udev_device_new_from_environment() 2010-03-17 17:42:35 +01:00
Kay Sievers 9d1a67e956 libudev: docs - .gitignore backup files 2010-03-11 13:01:48 +01:00
Kay Sievers fbb31cd6e1 libbudev-private: rename udev_list_entry_get_flag() 2010-03-10 14:52:42 +01:00
David Zeuthen e32d5237ea Increase UTIL_LINE_SIZE from 2048 to 16384
Recent udisks versions, for LVM2 integration, ships with probers that
produce very long lines such as

UDISKS_LVM2_PV_VG_PV_LIST=
  uuid=98lyZl-Ya7U-p26Z-Ia7b-xf8u-xZqP-jc4njb;size=2000397795328;allocated_size=2000397795328
  uuid=iFs0cM-sxCF-ceQK-hZl1-kbwo-ZTjq-gSewQR;size=2000397795328;allocated_size=2000397795328
  [...]

e.g. roughly 100 bytes per LVM2 physical volume for each LVM2
PV encountered.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-03-02 17:11:10 -05:00
David Zeuthen 3a19299202 Use UTIL_LINE_SIZE, not UTIL_PATH_SIZE to truncate properties
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-03-02 17:07:14 -05:00
David Zeuthen ecd42de2c5 Decrease buffer size when advancing past NUL byte
Otherwise we'll overflow the buffer if space is tight. Also add a comment explaining this.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-03-02 17:06:33 -05:00
Scott James Remnant a571c23e95 libudev: export udev_monitor_set_receive_buffer_size()
This function is useful for anything that's likely to be running
alongside udevd during cold-plugging, and is using libudev to
receive the events.

It makes little sense for it to be private, or to require other
software to relearn how to adjust the buffer size.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
2010-02-17 15:26:00 +00:00