[gnome-disk-utility] lvm2: Implement various GduDrive vfuncs related to activation
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-disk-utility] lvm2: Implement various GduDrive vfuncs related to activation
- Date: Fri, 19 Feb 2010 20:10:07 +0000 (UTC)
commit 66edc57614e6a2923e11de3aa9daff686bfcdf79
Author: David Zeuthen <davidz redhat com>
Date: Thu Feb 18 11:55:02 2010 -0500
lvm2: Implement various GduDrive vfuncs related to activation
src/gdu/gdu-linux-lvm2-volume-group.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/src/gdu/gdu-linux-lvm2-volume-group.c b/src/gdu/gdu-linux-lvm2-volume-group.c
index fe830a0..f7a9225 100644
--- a/src/gdu/gdu-linux-lvm2-volume-group.c
+++ b/src/gdu/gdu-linux-lvm2-volume-group.c
@@ -521,32 +521,37 @@ _gdu_linux_lvm2_volume_group_rewrite_enclosing_presentable (GduLinuxLvm2VolumeGr
}
/* ---------------------------------------------------------------------------------------------------- */
-
/* GduDrive virtual method overrides */
static gboolean
gdu_linux_lvm2_volume_group_is_active (GduDrive *drive)
{
- return TRUE;
+ GduLinuxLvm2VolumeGroup *vg = GDU_LINUX_LVM2_VOLUME_GROUP (drive);
+ return gdu_linux_lvm2_volume_group_get_state (vg) != GDU_LINUX_LVM2_VOLUME_GROUP_STATE_NOT_RUNNING;
}
static gboolean
gdu_linux_lvm2_volume_group_is_activatable (GduDrive *drive)
{
- return FALSE;
+ return TRUE;
}
static gboolean
gdu_linux_lvm2_volume_group_can_deactivate (GduDrive *drive)
{
- return FALSE;
+ GduLinuxLvm2VolumeGroup *vg = GDU_LINUX_LVM2_VOLUME_GROUP (drive);
+ return gdu_linux_lvm2_volume_group_get_state (vg) != GDU_LINUX_LVM2_VOLUME_GROUP_STATE_NOT_RUNNING;
}
static gboolean
gdu_linux_lvm2_volume_group_can_activate (GduDrive *drive,
gboolean *out_degraded)
{
- return FALSE;
+ GduLinuxLvm2VolumeGroup *vg = GDU_LINUX_LVM2_VOLUME_GROUP (drive);
+ /* TODO: actually compute out_degraded and also return FALSE in case we can't even start in degraded mode */
+ if (out_degraded != NULL)
+ *out_degraded = FALSE;
+ return gdu_linux_lvm2_volume_group_get_state (vg) != GDU_LINUX_LVM2_VOLUME_GROUP_STATE_RUNNING;
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]