[gnome-disk-utility] Handle loop devices
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-disk-utility] Handle loop devices
- Date: Thu, 11 Mar 2010 21:45:21 +0000 (UTC)
commit 1bf3bb4fccc43f7c2140e253a974750765b02a5b
Author: David Zeuthen <davidz redhat com>
Date: Thu Mar 11 16:40:37 2010 -0500
Handle loop devices
src/gdu/gdu-device.c | 22 ++++++++++++++++++++++
src/gdu/gdu-device.h | 3 +++
2 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/src/gdu/gdu-device.c b/src/gdu/gdu-device.c
index 10b4f20..6a5afad 100644
--- a/src/gdu/gdu-device.c
+++ b/src/gdu/gdu-device.c
@@ -75,6 +75,7 @@ typedef struct
gboolean device_is_linux_lvm2_pv;
gboolean device_is_linux_dmmp;
gboolean device_is_linux_dmmp_component;
+ gboolean device_is_linux_loop;
char **device_mount_paths;
uid_t device_mounted_by_uid;
gboolean device_presentation_hide;
@@ -192,6 +193,8 @@ typedef struct
gchar **linux_dmmp_slaves;
gchar *linux_dmmp_parameters;
+ gchar *linux_loop_filename;
+
} DeviceProperties;
static void
@@ -260,6 +263,8 @@ collect_props (const char *key,
props->device_is_linux_dmmp = g_value_get_boolean (value);
else if (strcmp (key, "DeviceIsLinuxDmmpComponent") == 0)
props->device_is_linux_dmmp_component = g_value_get_boolean (value);
+ else if (strcmp (key, "DeviceIsLinuxLoop") == 0)
+ props->device_is_linux_loop = g_value_get_boolean (value);
else if (strcmp (key, "DeviceIsMounted") == 0)
props->device_is_mounted = g_value_get_boolean (value);
else if (strcmp (key, "DeviceMountPaths") == 0)
@@ -523,6 +528,9 @@ collect_props (const char *key,
else if (strcmp (key, "LinuxDmmpParameters") == 0)
props->linux_dmmp_parameters = g_strdup (g_value_get_string (value));
+ else if (strcmp (key, "LinuxLoopFilename") == 0)
+ props->linux_loop_filename = g_strdup (g_value_get_string (value));
+
else
handled = FALSE;
@@ -605,6 +613,8 @@ device_properties_free (DeviceProperties *props)
g_strfreev (props->linux_dmmp_slaves);
g_free (props->linux_dmmp_parameters);
+ g_free (props->linux_loop_filename);
+
g_free (props);
}
@@ -1042,6 +1052,12 @@ gdu_device_is_linux_dmmp_component (GduDevice *device)
}
gboolean
+gdu_device_is_linux_loop (GduDevice *device)
+{
+ return device->priv->props->device_is_linux_loop;
+}
+
+gboolean
gdu_device_is_mounted (GduDevice *device)
{
return device->priv->props->device_is_mounted;
@@ -1617,6 +1633,12 @@ gdu_device_linux_dmmp_get_parameters (GduDevice *device)
return device->priv->props->linux_dmmp_parameters;
}
+const char *
+gdu_device_linux_loop_get_filename (GduDevice *device)
+{
+ return device->priv->props->linux_loop_filename;
+}
+
/* ---------------------------------------------------------------------------------------------------- */
gboolean
diff --git a/src/gdu/gdu-device.h b/src/gdu/gdu-device.h
index 38a7365..4c1302b 100644
--- a/src/gdu/gdu-device.h
+++ b/src/gdu/gdu-device.h
@@ -94,6 +94,7 @@ gboolean gdu_device_is_linux_lvm2_lv (GduDevice *device);
gboolean gdu_device_is_linux_lvm2_pv (GduDevice *device);
gboolean gdu_device_is_linux_dmmp (GduDevice *device);
gboolean gdu_device_is_linux_dmmp_component (GduDevice *device);
+gboolean gdu_device_is_linux_loop (GduDevice *device);
gboolean gdu_device_is_mounted (GduDevice *device);
const char *gdu_device_get_mount_path (GduDevice *device);
char **gdu_device_get_mount_paths (GduDevice *device);
@@ -205,6 +206,8 @@ const char *gdu_device_linux_dmmp_get_name (GduDevice *device);
char **gdu_device_linux_dmmp_get_slaves (GduDevice *device);
const char *gdu_device_linux_dmmp_get_parameters (GduDevice *device);
+const char *gdu_device_linux_loop_get_filename (GduDevice *device);
+
gboolean gdu_device_drive_ata_smart_get_is_available (GduDevice *device);
guint64 gdu_device_drive_ata_smart_get_time_collected (GduDevice *device);
const gchar *gdu_device_drive_ata_smart_get_status (GduDevice *device);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]