hal/libhal-storage libhal-storage.c, 1.21, 1.22 libhal-storage.h, 1.12, 1.13

David Zeuthen david at freedesktop.org
Wed Aug 10 13:34:23 PDT 2005


Update of /cvs/hal/hal/libhal-storage
In directory gabe:/tmp/cvs-serv14176/libhal-storage

Modified Files:
	libhal-storage.c libhal-storage.h 
Log Message:
2005-08-10  David Zeuthen  <davidz at redhat.com>

        * libhal-storage/libhal-storage.c (libhal_volume_from_udi): Actually
        export the right volume.fsusage



Index: libhal-storage.c
===================================================================
RCS file: /cvs/hal/hal/libhal-storage/libhal-storage.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- libhal-storage.c	29 Jul 2005 17:57:04 -0000	1.21
+++ libhal-storage.c	10 Aug 2005 20:34:21 -0000	1.22
@@ -997,6 +997,7 @@
 libhal_volume_from_udi (LibHalContext *hal_ctx, const char *udi)
 {
 	char *disc_type_textual;
+	char *vol_fsusage_textual;
 	LibHalVolume *vol;
 	LibHalPropertySet *properties;
 	LibHalPropertySetIterator it;
@@ -1007,6 +1008,7 @@
 	vol = NULL;
 	properties = NULL;
 	disc_type_textual = NULL;
+	vol_fsusage_textual = NULL;
 
 	dbus_error_init (&error);
 	if (!libhal_device_query_capability (hal_ctx, udi, "volume", &error))
@@ -1047,6 +1049,7 @@
 		LIBHAL_PROP_EXTRACT_STRING ("volume.mount_point",        vol->mount_point);
 		LIBHAL_PROP_EXTRACT_STRING ("volume.fstype",             vol->fstype);
 		LIBHAL_PROP_EXTRACT_BOOL   ("volume.is_mounted",         vol->is_mounted);
+		LIBHAL_PROP_EXTRACT_STRING ("volume.fsusage",            vol_fsusage_textual);
 
 		LIBHAL_PROP_EXTRACT_BOOL   ("volume.is_disc",            vol->is_disc);
 		LIBHAL_PROP_EXTRACT_STRING ("volume.disc.type",          disc_type_textual);
@@ -1087,10 +1090,26 @@
 		}
 	}
 
+	if (vol_fsusage_textual != NULL) {
+		if (strcmp (vol_fsusage_textual, "filesystem") == 0) {
+			vol->fsusage = LIBHAL_VOLUME_USAGE_MOUNTABLE_FILESYSTEM;
+		} else if (strcmp (vol_fsusage_textual, "partitiontable") == 0) {
+			vol->fsusage = LIBHAL_VOLUME_USAGE_PARTITION_TABLE;
+		} else if (strcmp (vol_fsusage_textual, "raid") == 0) {
+			vol->fsusage = LIBHAL_VOLUME_USAGE_RAID_MEMBER;
+		} else if (strcmp (vol_fsusage_textual, "crypto") == 0) {
+			vol->fsusage = LIBHAL_VOLUME_USAGE_CRYPTO;
+		} else {
+			vol->fsusage = LIBHAL_VOLUME_USAGE_UNKNOWN;
+		} 
+	}
+
+	libhal_free_string (vol_fsusage_textual);
 	libhal_free_string (disc_type_textual);
 	libhal_free_property_set (properties);
 	return vol;
 error:
+	libhal_free_string (vol_fsusage_textual);
 	libhal_free_string (disc_type_textual);
 	libhal_free_property_set (properties);
 	libhal_volume_free (vol);

Index: libhal-storage.h
===================================================================
RCS file: /cvs/hal/hal/libhal-storage/libhal-storage.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- libhal-storage.h	29 Jul 2005 20:32:58 -0000	1.12
+++ libhal-storage.h	10 Aug 2005 20:34:21 -0000	1.13
@@ -238,7 +238,9 @@
 typedef enum {
 	LIBHAL_VOLUME_USAGE_MOUNTABLE_FILESYSTEM,
 	LIBHAL_VOLUME_USAGE_PARTITION_TABLE,
-	LIBHAL_VOLUME_USAGE_RAID_MEMBER
+	LIBHAL_VOLUME_USAGE_RAID_MEMBER,
+	LIBHAL_VOLUME_USAGE_CRYPTO,
+	LIBHAL_VOLUME_USAGE_UNKNOWN
 } LibHalVolumeUsage;
 
 typedef enum {




More information about the hal-commit mailing list