hal/hald/linux2 blockdev.c,1.36,1.37

David Zeuthen david at freedesktop.org
Sun Feb 12 18:16:59 PST 2006


Update of /cvs/hal/hal/hald/linux2
In directory gabe:/tmp/cvs-serv19949/hald/linux2

Modified Files:
	blockdev.c 
Log Message:
2006-02-12  David Zeuthen  <davidz at redhat.com>

        * tools/hal-system-storage-mount: Use [:alnum:] and [:space:]
        instead of a-zA-Z0-9 so we support mount points like "foobar der
        æøå サイトの". Set LANG to en_US.UTF-8 to get bash to do this.
        Also allow - in GIVEN_MOUNTOPTIONS (Reported by Jeffrey Stedfast
        <fejj at novell.com>) in order to get iocharset= to work.

        * tools/hal-system-storage-cleanup-mountpoints: Make this work for
        mountpoints with spaces in them

        * hald/linux2/blockdev.c (blockdev_refresh_mount_state): Also
        remove info.hal_mount properties.
        (blockdev_generate_add_hotplug_event): For Reprobe, pass the
        model, vendor, serial and firmware rev.



Index: blockdev.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/blockdev.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- blockdev.c	12 Feb 2006 22:38:44 -0000	1.36
+++ blockdev.c	13 Feb 2006 02:16:57 -0000	1.37
@@ -269,6 +269,10 @@
 						0,
 						cleanup_mountpoint_cb,
 						g_strdup (mount_point), NULL);
+
+			hal_device_property_remove (dev, "info.hal_mount.created_mount_point");
+			hal_device_property_remove (dev, "info.hal_mount.mounted_by_uid");
+
 		}
 
 		g_free (mount_point_hal_file);
@@ -1219,20 +1223,35 @@
 {
 	const char *sysfs_path;
 	const char *device_file;
+	const char *model;
+	const char *vendor;
+	const char *serial;
+	const char *revision;
 	HotplugEvent *hotplug_event;
+	const char *nul;
+
+	nul = "\0";
 
 	sysfs_path = hal_device_property_get_string (d, "linux.sysfs_path");
+
 	device_file = hal_device_property_get_string (d, "block.device");
+	model       = hal_device_property_get_string (d, "storage.model");
+	vendor      = hal_device_property_get_string (d, "storage.vendor");
+	serial      = hal_device_property_get_string (d, "storage.serial");
+	revision    = hal_device_property_get_string (d, "storage.firmware_revision");
 
 	hotplug_event = g_new0 (HotplugEvent, 1);
 	hotplug_event->action = HOTPLUG_ACTION_ADD;
 	hotplug_event->type = HOTPLUG_EVENT_SYSFS;
 	g_strlcpy (hotplug_event->sysfs.subsystem, "block", sizeof (hotplug_event->sysfs.subsystem));
 	g_strlcpy (hotplug_event->sysfs.sysfs_path, sysfs_path, sizeof (hotplug_event->sysfs.sysfs_path));
-	if (device_file != NULL)
-		g_strlcpy (hotplug_event->sysfs.device_file, device_file, sizeof (hotplug_event->sysfs.device_file));
-	else
-		hotplug_event->sysfs.device_file[0] = '\0';
+
+	g_strlcpy (hotplug_event->sysfs.device_file, device_file != NULL ? device_file : nul, HAL_NAME_MAX);
+	g_strlcpy (hotplug_event->sysfs.vendor,           vendor != NULL ?      vendor : nul, HAL_NAME_MAX);
+	g_strlcpy (hotplug_event->sysfs.model,             model != NULL ?       model : nul, HAL_NAME_MAX);
+	g_strlcpy (hotplug_event->sysfs.serial,           serial != NULL ?      serial : nul, HAL_NAME_MAX);
+	g_strlcpy (hotplug_event->sysfs.revision,       revision != NULL ?    revision : nul, HAL_NAME_MAX);
+
 	hotplug_event->sysfs.net_ifindex = -1;
 
 	return hotplug_event;




More information about the hal-commit mailing list