summaryrefslogtreecommitdiff
path: root/hald/linux/blockdev.c
AgeCommit message (Collapse)AuthorFilesLines
2010-03-15fix storage.bus handling for SCSIDanny Kukawka1-5/+21
Fixed storage.bus handling for SCSI. Prevent fall through to PCI as storage bus. Current HAL marked SCSI storage devices which are not usb or ieee1394 get marked with storage.bus=pci and not as scsi.
2010-03-11add hotplug support for e-SATATakashi Iwai1-0/+2
Add hotplug support for e-SATA (bnc#576506); hotpluggable flag is set if ahci_cmd_port is exported in sysfs (available in the recent kernel)
2009-11-27fixed possible sscanf() NULL pointer crashesDanny Kukawka1-2/+5
Fixed possible sscanf() crashes caused by hal_util_get_last_element() returning a NULL pointer (in rare error case) which was used unchecked in sscanf() calls.
2009-11-26added breaks to detection of storage.bus for ccw, vio and pciDanny Kukawka1-0/+3
Added breaks to detection of storage.bus for ccw, vio and pci as e.g. in case of usb or ieee1394 to leave the while loop as soon as possible.
2009-09-25fix if/else block to find storage busDanny Kukawka1-3/+1
Fixed if/else block to find storage bus. Since info.subsystem is a string, there is no need to check for USB after SCSI. Added extra USB if block to the SCSI block as 'else if' to prevent unneeded double check.
2009-09-25fixed indentationDanny Kukawka1-47/+46
Fixed indentation in blockdev.c
2009-07-30fix commit 141ca8cd7b768ddefa1bfaa563cbef4337e32b7cDanny Kukawka1-1/+1
Fixed commit 141ca8cd7b768ddefa1bfaa563cbef4337e32b7c: add void as return type to hotplug_event_begin_add_blockdev, which was removed with this previous commit.
2009-07-30Merge branch 'master' of ssh://dkukawka@git.freedesktop.org/git/halDanny Kukawka1-2/+3
2009-07-29Fix a segfault in the mdraid code -- see rh#507782 for more infoMartin Poole1-2/+3
Signed-off-by: Richard Hughes <richard@hughsie.com>
2009-07-23fix usage of deprected g_io_channel_seek()Danny Kukawka1-1/+4
Fixed usage of deprected g_io_channel_seek(), replaced it with g_io_channel_seek_position().
2009-05-15fix crash when assembling certain MD devicesChris Coulson1-4/+13
Don't assume that the parent of a volume has storage capability; e. g. if we are an MD partition then this is the case as we were re-parented to the root computer device object earlier. FD#21603
2009-02-21remove unused pointer to struct mntent returned from getmntent_rGuillem Jover1-2/+1
Removed remove unused pointer to struct mntent returned from getmntent_r() .
2009-02-21fix some memory leaks on normal operationGuillem Jover1-0/+1
Fixed some memory leaks on normal operation. Some pointers were being lost when being overwritten by new values, others were just not being freed.
2008-11-15improve HAL performance for filesystem detectionDanny Kukawka1-3/+53
Improved HAL performance for filesystem detection. Call libvolume_id functions in the volume prober to get the following information only if we have no udev information about the filesystem: - volume.fsusage - volume.fstype - volume.fsversion - volume.uuid - volume.label HAL now simply use the already in the HotplugEvent stored information from udev if available, since udev already called libvolume_id to get these info. With this change HAL needs to probe only CD/DVD media and maybe fakevolume related volumes.
2008-11-15Revert "cleanup handling volume filesystem information"Danny Kukawka1-53/+3
This reverts commit 7aca1f3fefefd3c760636aabcff1e25946ab6391. Reverted the change to prevent trouble with CD/DVD media (because they are fakevolumes and udev tell us no information about the filesystem on insert the media).
2008-11-07add memstick/memstick_host supportMatthew Garrett1-0/+8
This adds basic memory stick support to hal. It's enough to get automounting up, but it doesn't expose any of the memory stick specific attributes yet since I'm not sure which of them are especially useful.
2008-11-05cleanup handling volume filesystem informationDanny Kukawka1-3/+53
Cleaned up handling of volume filesystem information. Don't call libvolume_id functions in the volume prober to get the following information: - volume.fsusage - volume.fstype - volume.fsversion - volume.uuid - volume.label HAL now simply use the already in the HotplugEvent stored information from udev, since udev already called libvolume_id to get these info.
2008-10-30fixed md related code in hotplug_event_begin_add_blockdev()Danny Kukawka1-1/+1
Fixed md related code to find/set the parent devie in hotplug_event_begin_add_blockdev().
2008-10-30add support for HP Smart Array CCISS block devicesDanny Kukawka1-48/+70
Added support for HP Smart Array CCISS block devices, which are in recent kernel versions virtual block/storage devices and no longer pci based (also if the Smart Array controller is a PCI device).
2008-10-28Revert "add support for bdi bases block devices"Danny Kukawka1-30/+0
This reverts commit 52390cd9e5f1ce48eb9b486044369f0e10a7865b.
2008-10-22add support for bdi bases block devicesDanny Kukawka1-0/+30
Added support for bdi bases (virtual) block devices as e.g. cciss storage devices on newer kernel versions. Changed device handling to find parent of a virtual bdi block device by checking either target of the bdi link (if available) or search for existing devices with the parent dir as sysfs path. Allow bdi as storage bus.
2008-10-22allow also PCI as possible storage.busDanny Kukawka1-0/+4
Allow also PCI as possible storage.bus, needed e.g. on older kernel versions to detect cciss storage devices.
2008-09-09inserts the sysfs path at the right position for call udevadmJürg Billeter1-1/+1
The inserts the sysfs path at the right position when calling udevadm info.
2008-08-27use udevadm instead of (deprecated) udevinfoDanny Kukawka1-1/+1
Use udevadm instead of (deprecated) udevinfo. Adapted/fixed version of a patch contributed by Lucas Hazel <lucas@die.net.au> via HAL ML.
2008-08-11remove storage.model property from volumesDanny Kukawka1-1/+0
Remove storage.model property from volumes. This property make no sense on a volume device and should be used only within the storage namespace.
2008-08-10volume.num_blocks can become larger than 2GMartin Pitt1-2/+2
Fix mounting of devices with a very large number of reported blocks by making it a 64 bit property. (https://launchpad.net/bugs/209483)
2008-08-10set Xen storage drive typePatrick Campbell1-0/+21
This sets Xen storage drive type based on contents of the devices sysfs media file. (Creation of sysfs media file was pushed into upstream Xen 07-28-08.)
2008-04-18fixed a bunch of compiler warnings from the Intel compilerDanny Kukawka1-5/+5
Fixed a bunch of compiler warnings from the Intel compiler (cce/icc 10.1.015). Closed a small memory leak in linux/hal-file-monitor.c
2008-03-13cleanup code, removed separate calls to set info.udiDanny Kukawka1-1/+0
Cleaned up the code. Removed all separate calls of hal_device_property_set_string (device, "info.udi", udi) so set the info.udi property of a device. moved the call to hal_device_set_udi(), this is now more consistent.
2008-03-12compute udis that are unique in the gdl and tdlRob Taylor1-24/+24
Introduces hald_compute_udi which computes a udi thats unique in both the tdl and gdl and uses it everywhere relvent. This is necessary when we're processing events in parallel as otherwise its possible to get a race condition with two devices added with the same name. As part of this patch, hal_util_compute_udi grwos a varargs version and no longer makes the computer udi unique. I've also added a hal_util_make_udi_unique for use in those places where hal_util_compute_udi was only used to check a udi was unique when inserting into the gdl.
2008-03-12use g_slice for hotplug eventsRob Taylor1-5/+7
Using g_slice should be better (and makes for cleaner code) than our current HotplugEvent pool.
2008-03-06generate better udis for virtual storage devicesDanny Kukawka1-0/+9
Generate better UDIs for virtual storage devices (like vio bus devices).
2008-03-06updated spec for existing storage.bus typesDanny Kukawka1-2/+1
Updated spec for existing storage.bus types (pcmcia,mmc,ccw,vio)
2008-03-06added vio storage bus supportOlaf Hering1-0/+22
Added vio storage bus support. Set storage.bus and storage.drive_type for vio storage devices.
2008-03-03use g_timeout_add_seconds() where appropriate if glib 2.14 is availableSven Neumann1-0/+4
As you probably know already, glib 2.14 introduced variants of the g_timeout_add() functions that operate at whole second granularity. This allows timers to be grouped, which results in a more power and CPU efficient behavior. Attached is a patch that adds a configure check for GLib 2.14 and changes some code (notably in the Linux specific parts) to use the new functions when possible.
2008-03-03removed deprecated and outdated *.physical_deviceDanny Kukawka1-2/+0
Removed deprecated *.physical_device property from hal. The key reached end of lifetime with 2008-03-01 and was replaced by *.originating_device.
2007-12-06linear MD device are not syncableFlorent Mertens1-42/+48
Hello all, Linear MD device are not syncable, and so there is no sync-action in /sys/block/md0/md/ (at least i don't have it). In the actual code, MD device are ignored if this file is not found. The attched path fix that issue. Cheers, Mertens Florent
2007-08-09use hardcoded paths to sysfs and procDanny Kukawka1-3/+3
Commited updated and tested patch from Richard Hughes <hughsient@gmail.com> to use hardcoded paths to /sys and /proc instead of all the not really needed calls of get_hal_{proc,sysfs}_path() because sysfs is always under /sys and proc under /proc. This remove also several g_strlcat()/ g_strlcpy() calls and some variables.
2007-07-19avoid polling SATA AN capable drives and rely on "change" ueventsDavid Zeuthen1-1/+26
This allows us to avoid waking up libata all the freaking time. Also, to do this refactor and rewire some of the support for "change" uevents in the hal core. See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=halpolling for further discussion.
2007-07-17allow IDE media detection if /proc/ide is missingAndrey Borzenkov1-0/+7
/proc/ide is optional in 2.6.22; let hald get media information from sysfs if /proc/ide does not exist. May be we can always do it instead.
2007-07-03free volumelabel from commit 2d1d72e8Danny Kukawka1-0/+1
Free volumelabel introduced with commit 2d1d72e8 as pointed out by Iulian Ciorascu <iulica@box.co.uk>.
2007-07-03replace '/' in volume labels with '_' if part of UDIDanny Kukawka1-2/+7
This fixes fd.o #11401 by replacing '/' in volume labels with '_' if they get part of the UDI. This should avoid trouble with D-Bus.
2007-05-06use correct integer sizeDavid Zeuthen1-2/+2
2007-05-06recognize Linux MD aka Software RAID devicesDavid Zeuthen1-10/+477
Since pictures says more than a thousand words... http://people.freedesktop.org/~david/hal-md-normal.png http://people.freedesktop.org/~david/hal-md-degraded.png http://people.freedesktop.org/~david/hal-md-recover.png This patch only adds detection by exploiting the fact that in Linux 2.6.19 and later /proc/mdstat is pollable. Later on we'll add D-Bus interfaces to add methods for assembly, teardown of RAID arrays as well as adding hot spares. I wonder if it's worth abstracting Software RAID so FreeBSD and Solaris can implement this too? It's probably too different.. Thoughts?
2007-05-03creating link /dev/root to device / is mounted fromKay Sievers1-40/+49
On 4/23/07, David Zeuthen <david@fubar.dk> wrote: > On Sun, 2007-04-22 at 14:01 +0200, Kay Sievers wrote: > > But we may just want to change HAL to handle mnt_dir == "/" as a > > special case, instead of assuming the name to be a device-node. That > > should solve the real problem we are seeing here. > > I'm fine taking a patch to do that. Thanks! Does this work for you Doug? Thanks, Kay
2007-03-01fix device removal when mounted devices not mounted by HAL are yanked outDavid Zeuthen1-25/+9
See RH #227593 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=227593 The fix was trivial as the bug was so obvious - we simply forget to process hotplug events when we detect that HAL didn't mount the device.
2007-03-01fix detection of mounted volumes from yanked storage devicesDavid Zeuthen1-28/+50
This should fix some problems when mounted devices are yanked out. At least that's the problem I had with my new 4GB SanDisk U3 Cruzer Micro. I have two partitions on it - one cleartext vfat partition and one LUKS partition. When yanking the stick, HAL nicely reported that the cleartext partition was unmounted even though it was still mounted. Which is a lie. There's a race we don't handle. In particular, the device node for a device, such as /dev/sdb1, may have been unlinked by udev but the device is still mounted and we haven't processed the uevent for that deletion from udev. So when we process entries from /proc/mounts we fail to stat the device node /dev/sdb1 and this leads us to assume the device is not mounted. That's wrong. So in this case fall back to comparing on device names rather than pretending the device is not mounted as that's what will happen if we just skip this /proc/mounts entry. The reason it's nicer to compare on major:minor, and why we do that in general, is that /proc/mounts is *broken by design* - it contains the *device name* passed to mount(2) which in some cases may be a symlink. In fact, on many distros it's common to see /proc/mounts contain /dev/root as the device for /.
2007-02-07rename "bus" and "physical" properties to something more abstractKay Sievers1-6/+8
Current systems make it almost impossible to distinguish between "virtual" and "physical" devices. Current HAL, just like the Linux kernel, tries to export such properties - which in reality, is almost impossible to get right. The growing use of virtualization will just make it even more incorrect. HAL also carries, just like the Linux kernel, completely misleading bus names like: platform-bus, xen-bus, usb_device-bus, ... Most of these subsystems are no bus at all, and will never be one. Renames: info.bus -> info.subsystem *.physical_device -> *.originating_device The old values are deprecated, but still available and kept as long as needed, but will be removed some day.
2007-01-31Make hotplugging non-recursive.Rob Taylor1-2/+0
This adds a notify callback for when hald_runner has finished calling a callout. For linux, we install hotplug_event_process_queue as the notify, and modify hotplug_event_process_queue to iterate the queue. All recrursive calls to hotplug_event_process_queue are removed. This results in massive stack and a not inconsiquential heap savings.
2007-01-11Remove linux.sysfs_path_device keyRob Taylor1-1/+0
linux.sysfs_path_device is no longer needed internally in HAL. Removing without going through deprectation process as this key was documen as only used internally and not guaranteed to exist, so noone should be usi it. Also fixes problems with mmc and scsi devices getting incorrectly parented in the device tree.