summaryrefslogtreecommitdiff
path: root/libhal-storage
diff options
context:
space:
mode:
authorDavid Zeuthen <david@fubar.dk>2005-08-10 20:34:21 +0000
committerDavid Zeuthen <david@fubar.dk>2005-08-10 20:34:21 +0000
commit9436fd74cefa7d475be37fe21a8d5a425a431866 (patch)
treee82a644ef622b0793e178939018140d76e55cc59 /libhal-storage
parent2dd6e7f01ff58eb151f56cd0264e7c26e312cd36 (diff)
Actually export the right volume.fsusage
Diffstat (limited to 'libhal-storage')
-rw-r--r--libhal-storage/libhal-storage.c19
-rw-r--r--libhal-storage/libhal-storage.h4
2 files changed, 22 insertions, 1 deletions
diff --git a/libhal-storage/libhal-storage.c b/libhal-storage/libhal-storage.c
index e9032844..0c74218b 100644
--- a/libhal-storage/libhal-storage.c
+++ b/libhal-storage/libhal-storage.c
@@ -997,6 +997,7 @@ LibHalVolume *
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 @@ libhal_volume_from_udi (LibHalContext *hal_ctx, const char *udi)
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_volume_from_udi (LibHalContext *hal_ctx, const char *udi)
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 @@ libhal_volume_from_udi (LibHalContext *hal_ctx, const char *udi)
}
}
+ 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);
diff --git a/libhal-storage/libhal-storage.h b/libhal-storage/libhal-storage.h
index 94e475df..ffd3d174 100644
--- a/libhal-storage/libhal-storage.h
+++ b/libhal-storage/libhal-storage.h
@@ -238,7 +238,9 @@ char *libhal_drive_policy_default_get_managed_keyword_secondary (LibHalCo
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 {