hal/hald/linux block_class_device.c,1.79,1.80
David Zeuthen
david at freedesktop.org
Mon Sep 27 07:49:47 PDT 2004
Update of /cvs/hal/hal/hald/linux
In directory gabe:/tmp/cvs-serv8139/hald/linux
Modified Files:
block_class_device.c
Log Message:
2004-09-27 David Zeuthen <david at fubar.dk>
* libhal/libhal.c:
(struct LibHalContext_s): add is_shutdown field
(filter_func): if ctx->is_shutdown is TRUE don't process the message.
Return NOT_YET_HANDLED instead of HANDLED on all messages as several
libhal contexts may want to process them.
(hal_initialize): Set ctx->is_shutdown to FALSE
(hal_shutdown): Remove the matching rule on the Manager object and
set is_shutdown to TRUE. Don't fix the leak on the DBusConnection
because leaking it means that the application will terminate. Hence
introduce a leak of the LibHalContext since shutdown is async. Add
a few TODO comments about that this needs fixing (probably needs
dbus_bus_get_dedicated).
* hald/hald_dbus.c (sender_has_superuser_privileges): New function
(device_set_property): Require superuser
(device_add_capability): Require superuser
* hald/linux/block_class_device.c (block_class_pre_process): Add checks
for SATA disks - code snippet from Alan Cox <alan at redhat.com>
Index: block_class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/block_class_device.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- block_class_device.c 24 Sep 2004 22:27:20 -0000 1.79
+++ block_class_device.c 27 Sep 2004 14:49:45 -0000 1.80
@@ -1181,30 +1181,26 @@
scsidev = d_it;
physdev = d_it;
physdev_udi = udi_it;
- hal_device_property_set_string (
- stordev, "storage.bus", "scsi");
+ hal_device_property_set_string (stordev, "storage.bus", "scsi");
}
if (strcmp (bus, "usb") == 0) {
physdev = d_it;
physdev_udi = udi_it;
is_hotpluggable = TRUE;
- hal_device_property_set_string (
- stordev, "storage.bus", "usb");
+ hal_device_property_set_string (stordev, "storage.bus", "usb");
break;
} else if (strcmp (bus, "ieee1394") == 0) {
physdev = d_it;
physdev_udi = udi_it;
is_hotpluggable = TRUE;
- hal_device_property_set_string (
- stordev, "storage.bus", "ieee1394");
+ hal_device_property_set_string (stordev, "storage.bus", "ieee1394");
break;
} else if (strcmp (bus, "ide") == 0) {
physdev = d_it;
physdev_udi = udi_it;
- hal_device_property_set_string (
- stordev, "storage.bus", "ide");
+ hal_device_property_set_string (stordev, "storage.bus", "ide");
break;
}
@@ -1499,6 +1495,22 @@
}
drive_id_close(did);
+ /* see if this is really a SATA disk */
+#if 0
+ /* commented out until the value of ATA_IOC_GET_IO32 is available */
+ {
+ int fd;
+ unsigned char unused;
+
+ if ((fd = open (device_file, O_RDONLY|O_NDELAY)) != -1) {
+ if (ioctl (fd, ATA_IOC_GET_IO32, &unused) >= 0) {
+ hal_device_property_set_string (stordev, "storage.bus", "sata");
+ }
+ close (fd);
+ }
+ }
+#endif
+
snprintf (attr_path, SYSFS_PATH_MAX,
"%s/device/type", sysfs_path);
attr = sysfs_open_attribute (attr_path);
More information about the hal-commit
mailing list