hal/hald/linux block_class_device.c, 1.43, 1.44 class_device.c, 1.22, 1.23 osspec.c, 1.28, 1.29

David Zeuthen david at freedesktop.org
Thu Jul 22 12:06:04 PDT 2004


Update of /cvs/hal/hal/hald/linux
In directory pdx:/tmp/cvs-serv30212a/hald/linux

Modified Files:
	block_class_device.c class_device.c osspec.c 
Log Message:
2004-07-22  David Zeuthen  <david at fubar.dk>

	* tools/linux/hal_hotplug.c (main): Apply the same hack we did to
	hal_dev.c some time ago; improves hotplugging speed; suggestion by
	Sjoerd Simons.

	* hald/linux/block_class_device.c (block_class_visit): Fixed a nasty
	bug where .udev.sysfs_path were set before other key properties. This
	resulted in lack of information in handle_udev_node_created_found_device
	that was invoked as soon as .udev.sysfs_path were set. Obviously
	this situation was only applicable when we got the DeviceEvent before
	the HotplugEvent. udev is indeed fast.

	* hald/linux/class_device.c (class_device_visit): -do-



Index: block_class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/block_class_device.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- block_class_device.c	21 Jul 2004 17:14:54 -0000	1.43
+++ block_class_device.c	22 Jul 2004 19:06:01 -0000	1.44
@@ -127,11 +127,9 @@
 	}
 
 	/* temporary property used for _udev_event() */
-	hal_device_property_set_string (d, ".udev.sysfs_path", path);
-	hal_device_property_set_string (d, ".udev.class_name", "block");
-
-	/* Property name we should store the device file in */
 	hal_device_property_set_string (d, ".target_dev", "block.device");
+	hal_device_property_set_string (d, ".udev.class_name", "block");
+	hal_device_property_set_string (d, ".udev.sysfs_path", path);
 
 	/* Ask udev about the device file if we are probing */
 	if (self->require_device_file && hald_is_initialising) {

Index: class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/class_device.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- class_device.c	21 Jul 2004 22:32:17 -0000	1.22
+++ class_device.c	22 Jul 2004 19:06:01 -0000	1.23
@@ -146,11 +146,6 @@
 		}
 	} 
 
-	/* Temporary property used for _udev_event() */
-	hal_device_property_set_string (d, ".udev.sysfs_path", path);
-	hal_device_property_set_string (d, ".udev.class_name", 
-					self->sysfs_class_name);
-
 	/* We may require a device file */
 	if (self->require_device_file) {
 
@@ -158,11 +153,21 @@
 		self->get_device_file_target (self, d, path, class_device,
 					      dev_file_prop_name, 
 					      SYSFS_PATH_MAX);
+
+		/* Temporary property used for _udev_event() */
 		hal_device_property_set_string (d, ".target_dev", 
 						dev_file_prop_name);
+	}
 
+	hal_device_property_set_string (
+		d, ".udev.class_name", self->sysfs_class_name);
+	hal_device_property_set_string (
+		d, ".udev.sysfs_path", path);
+
+	if (self->require_device_file) {
 		/* Ask udev about the device file if we are probing */
 		if (hald_is_initialising) {
+
 			if (!class_device_get_device_file (path, dev_file, 
 							   SYSFS_PATH_MAX)) {
 				HAL_WARNING (("Couldn't get device file for "
@@ -173,7 +178,7 @@
 			/* If we are not probing this function will be called 
 			 * upon receiving a dbus event */
 			self->udev_event (self, d, dev_file);
-		}
+		} 
 	}
 
 	/* Now find the physical device; this happens asynchronously as it

Index: osspec.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/osspec.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- osspec.c	21 Jul 2004 22:32:17 -0000	1.28
+++ osspec.c	22 Jul 2004 19:06:01 -0000	1.29
@@ -660,10 +660,12 @@
 	if (d != NULL) {
 		HAL_INFO (("dev_file=%s is for udi=%s", dev_file, d->udi));
 
+		hal_device_print (d);
+
 		sysfs_class_name = 
 			hal_device_property_get_string (d, ".udev.class_name");
 
-		/*HAL_INFO ((".udev.class_name = %s", sysfs_class_name));*/
+		HAL_INFO ((".udev.class_name = %s", sysfs_class_name));
 
 		for (i=0; class_device_handlers[i] != NULL; i++) {
 			ClassDeviceHandler *ch = class_device_handlers[i];




More information about the hal-commit mailing list