hal/hald/linux block_class_device.c,1.60,1.61

Kay Sievers kay at freedesktop.org
Wed Aug 25 16:56:12 PDT 2004


Update of /cvs/hal/hal/hald/linux
In directory gabe:/tmp/cvs-serv1266/hald/linux

Modified Files:
	block_class_device.c 
Log Message:
2004-08-26  Kay Sievers  <kay.sievers at vrfy.org>

        * doc/spec/hal-spec.xml.in: Add description of "volume.fsusage"

        * hald/linux/block_class_device.c:
        (set_volume_id_values): Use "volume.fsusage" instead of "is_filesystem"
        and "is_part_of_raid"
        (detect_media), (block_class_pre_process): Set missing defaults and
        remove "is_filesystem"

        * hald/linux/volume_id/volume_id.c: (probe_linux_raid),
        (probe_msdos_part_table), (probe_ext), (probe_reiserfs),
        (probe_xfs), (probe_jfs), (probe_vfat), (probe_udf),
        (probe_iso9660), (probe_ufs), (probe_mac_partition_map),
        (probe_hfs_hfsplus), (probe_ntfs), (probe_swap): Switch naming
        form "format" and "type" to "type" and "usage" to match the
        names we use in HAL now. 

        * tools/fstab-sync.c: (udi_is_volume_or_nonpartition_drive):
        Switch from "is_filesystem" to "volume.fsusage" to determine
        if the volume is mountable



Index: block_class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/block_class_device.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- block_class_device.c	25 Aug 2004 20:20:22 -0000	1.60
+++ block_class_device.c	25 Aug 2004 23:56:09 -0000	1.61
@@ -83,36 +83,42 @@
 static void
 set_volume_id_values(HalDevice *d, struct volume_id *vid)
 {
-	char *product;
+	const char *product;
+	const char *usage;
 
-	switch (vid->type_id) {
+	switch (vid->usage_id) {
 	case VOLUME_ID_FILESYSTEM:
-		hal_device_property_set_bool (d, "volume.is_filesystem", TRUE);
+		usage = "filesystem";
+		break;
+	case VOLUME_ID_PARTITIONTABLE:
+		usage = "partitiontable";
+		break;
+	case VOLUME_ID_OTHER:
+		usage = "other";
 		break;
 	case VOLUME_ID_RAID:
-		hal_device_property_set_bool (d, "volume.is_part_of_raid", TRUE);
+		usage = "raid";
 		break;
 	case VOLUME_ID_UNUSED:
 		hal_device_property_set_string (d, "info.product", "Volume (unused)");
+		usage = "unused";
 		return;
 	default:
-		;
+		usage = "";
 	}
+	hal_device_property_set_string (d, "volume.fsusage", usage);
 
-	hal_device_property_set_string (d, "volume.fstype", vid->format);
-	if (vid->format_version[0] != '\0')
+	hal_device_property_set_string (d, "volume.fstype", vid->type);
+	if (vid->type_version[0] != '\0')
 		hal_device_property_set_string (d, "volume.fsversion",
-						vid->format_version);
+						vid->type_version);
 	hal_device_property_set_string (d, "volume.uuid", vid->uuid);
 	hal_device_property_set_string (d, "volume.label", vid->label);
 
-	hal_device_property_set_bool (d, "volume.is_filesystem", 
-				      (vid->type_id == VOLUME_ID_FILESYSTEM));
-
 	if (vid->label[0] != '\0') {
 		hal_device_property_set_string (d, "info.product", vid->label);
 	} else {
-		product = g_strdup_printf ("Volume (%s)", vid->format);
+		product = g_strdup_printf ("Volume (%s)", vid->type);
 		hal_device_property_set_string (d, "info.product", product);
 		g_free (product);
 	}
@@ -928,8 +934,8 @@
 		hal_device_property_set_string (child, "info.product", "Volume");
 
 		/* set defaults */
-		hal_device_property_set_bool (d, "volume.is_filesystem", FALSE);
 		hal_device_property_set_string (child, "volume.fstype", "");
+		hal_device_property_set_string (child, "volume.fsversion", "");
 		hal_device_property_set_string (child, "volume.uuid", "");
 		hal_device_property_set_string (child, "volume.label", "");
 		hal_device_property_set_string (child, "volume.mount_point", "");
@@ -1187,9 +1193,9 @@
 		hal_device_property_set_string (d, "info.category", "volume");
 		hal_device_property_set_string (d, "info.product", "Volume");
 		hal_device_property_set_string (d, "volume.fstype", "");
+		hal_device_property_set_string (d, "volume.fsversion", "");
 		hal_device_property_set_string (d, "volume.label", "");
 		hal_device_property_set_string (d, "volume.uuid", "");
-		hal_device_property_set_bool (d, "volume.is_filesystem", FALSE);
 		hal_device_property_set_bool (d, "volume.is_disc", FALSE);
 		hal_device_property_set_bool (d, "volume.is_mounted", FALSE);
 
@@ -1226,7 +1232,7 @@
 			 * GRRRR!!!
 			 */
 			hal_device_property_set_string (d, "volume.fstype", "vfat,auto");
-			hal_device_property_set_bool (d, "volume.is_filesystem", TRUE);
+			hal_device_property_set_string (d, "volume.usage", "filesystem");
 		}
 		return;
 	}




More information about the hal-commit mailing list