]> sourceware.org Git - lvm2.git/commitdiff
o activation & active status tests
authorAlasdair Kergon <agk@redhat.com>
Wed, 21 Nov 2001 19:32:35 +0000 (19:32 +0000)
committerAlasdair Kergon <agk@redhat.com>
Wed, 21 Nov 2001 19:32:35 +0000 (19:32 +0000)
o lvdisplay fields from kernel
o update lv->size on resize

20 files changed:
lib/activate/activate.c
lib/activate/activate.h
lib/activate/fs.c
lib/display/display.c
lib/metadata/lv_manip.c
tools/lvchange.c
tools/lvcreate.c
tools/lvm.c
tools/lvremove.c
tools/lvrename.c
tools/lvresize.c
tools/pvchange.c
tools/pvcreate.c
tools/vgchange.c
tools/vgcreate.c
tools/vgextend.c
tools/vgreduce.c
tools/vgremove.c
tools/vgrename.c
tools/vgscan.c

index 2837446d7e40179c2ea74d3502f0d0a27844d043..7fb81ad270e5d3680383125ec214891d134ab7bf 100644 (file)
@@ -10,8 +10,6 @@
 #include "log.h"
 #include "fs.h"
 
-#include <devmapper/libdevmapper.h>
-
 static void _build_lv_name(char *buffer, size_t s, struct logical_volume *lv)
 {
        snprintf(buffer, s, "%s_%s", lv->vg->name, lv->name);
@@ -33,7 +31,7 @@ static struct dm_task *_setup_task(struct logical_volume *lv, int task)
        return dmt;
 }
 
-static int _info(struct logical_volume *lv, struct dm_info *info)
+int lv_info(struct logical_volume *lv, struct dm_info *info)
 {
        int r = 0;
        struct dm_task *dmt;
@@ -64,7 +62,7 @@ int lv_active(struct logical_volume *lv)
        int r = -1;
        struct dm_info info;
 
-       if (!_info(lv, &info)) {
+       if (!lv_info(lv, &info)) {
                stack;
                return r;
        }
@@ -77,7 +75,7 @@ int lv_open_count(struct logical_volume *lv)
        int r = -1;
        struct dm_info info;
 
-       if (!_info(lv, &info)) {
+       if (!lv_info(lv, &info)) {
                stack;
                return r;
        }
@@ -153,6 +151,8 @@ int _load(struct logical_volume *lv, int task)
        if (!(r = dm_task_run(dmt)))
                stack;
 
+       log_verbose("Logical volume %s activated", lv->name);
+
  out:
        dm_task_destroy(dmt);
        return r;
index f033488e50bc7257c01d14d5b627826ca7dbec78..e03efe17277a1bcab1ef4f69a7bb31939029f5ca 100644 (file)
@@ -7,10 +7,13 @@
 #ifndef LVM_ACTIVATE_H
 #define LVM_ACTIVATE_H
 
+#include <libdevmapper.h>
+
 /* FIXME Snapshot handling? */
 
 int lv_active(struct logical_volume *lv);
 int lv_open_count(struct logical_volume *lv);
+int lv_info(struct logical_volume *lv, struct dm_info *info);
 
 int lv_activate(struct logical_volume *lv);
 int lv_reactivate(struct logical_volume *lv);
index 617b04f0641042b357a9d11bdab0f4980a29274a..8b8e9a3fd7a14a14f9d4cab57e400a1115b4822c 100644 (file)
@@ -15,7 +15,7 @@
 #include "fs.h"
 #include "log.h"
 
-#include <devmapper/libdevmapper.h>
+#include <libdevmapper.h>
 
 void _build_lv_path(char *buffer, size_t len, struct logical_volume *lv)
 {
index daa5675484fb44d3f977daf211066d3a1ab65478..84617410adbc2be2f035b46467a90efb9bc3995e 100644 (file)
@@ -207,19 +207,24 @@ int pvdisplay_short(struct volume_group *vg, struct physical_volume *pv)
 
 void lvdisplay_colons(struct logical_volume *lv)
 {
-       log_print("%s/%s:%s:%d:%d:-1:%d:%" PRIu64 ":%d:-1:%d:%d:-1:-1",
-                 /* FIXME Prefix - attach to struct volume_group? */
+       int inkernel;
+       struct dm_info info;
+       inkernel = lv_info(lv, &info) && info.exists;
+
+       log_print("%s%s/%s:%s:%d:%d:-1:%d:%" PRIu64 ":%d:-1:%d:%d:%d:%d",
+                 lv->vg->cmd->dev_dir,
                  lv->vg->name,
                  lv->name,
                  lv->vg->name,
                  (lv->status & (LVM_READ | LVM_WRITE)) >> 8,
-                 lv->status & ACTIVE,
+                 inkernel ? 1 : 0,
                  /* FIXME lv->lv_number,  */
-                 lvs_in_vg_opened(lv->vg), lv->size, lv->le_count,
+                 inkernel ? info.open_count : 0, lv->size, lv->le_count,
                  /* FIXME Add num allocated to struct! lv->lv_allocated_le, */
                  ((lv->status & ALLOC_STRICT) +
-                  (lv->status & ALLOC_CONTIGUOUS) * 2), lv->read_ahead
-                 /* FIXME device num MAJOR(lv->lv_dev), MINOR(lv->lv_dev) */
+                  (lv->status & ALLOC_CONTIGUOUS) * 2), lv->read_ahead,
+                 inkernel ? info.major : -1,
+                 inkernel ? info.minor : -1
            );
        return;
 }
@@ -228,11 +233,15 @@ int lvdisplay_full(struct logical_volume *lv)
 {
        char *size;
        uint32_t alloc;
+       struct dm_info info;
+       int inkernel;
+
+       inkernel = lv_info(lv, &info) && info.exists;
 
        log_print("--- Logical volume ---");
 
-       /* FIXME Add dev_dir */
-       log_print("LV Name                %s/%s", lv->vg->name, lv->name);
+       log_print("LV Name                %s%s/%s", lv->vg->cmd->dev_dir,
+                 lv->vg->name, lv->name);
        log_print("VG Name                %s", lv->vg->name);
 
        log_print("LV Write Access        %s",
@@ -283,16 +292,19 @@ int lvdisplay_full(struct logical_volume *lv)
     }
 ***********/
 
-       log_print("LV Status              %savailable",
-                 (lv->status & ACTIVE) ? "" : "NOT ");
+       if (inkernel && info.suspended)
+               log_print("LV Status              suspended");
+       else
+               log_print("LV Status              %savailable",
+                         inkernel ? "" : "NOT ");
 
 /********* FIXME lv_number
     log_print("LV #                   %u", lv->lv_number + 1);
 ************/
 
-/********* FIXME lv_open
-    log_print("# open                 %u\n", lv->lv_open);
-**********/
+       if (inkernel)
+               log_print("# open                 %u", info.open_count);
+
 /********
 #ifdef LVM_FUTURE
     printf("Mirror copies          %u\n", lv->lv_mirror_copies);
@@ -374,7 +386,7 @@ int lvdisplay_full(struct logical_volume *lv)
                   (ALLOC_STRICT | ALLOC_CONTIGUOUS)) ? "strict/contiguous" :
                  "");
 
-       log_print("Read ahead sectors     %u\n", lv->read_ahead);
+       log_print("Read ahead sectors     %u", lv->read_ahead);
 
 /****************
 #ifdef LVM_FUTURE
@@ -386,15 +398,15 @@ int lvdisplay_full(struct logical_volume *lv)
 #endif
 *************/
 
-/********* FIXME blockdev 
-    printf("Block device           %d:%d\n",
-          MAJOR(lv->lv_dev), MINOR(lv->lv_dev));
-*************/
+       if (inkernel)
+               log_print("Block device           %d:%d", info.major, 
+                         info.minor);
+
+       log_print(" ");
 
        return 0;
 }
 
-
 void lvdisplay_extents(struct logical_volume *lv)
 {
        int le;
index 68651aaafde2f889aad2cd7ca5ec4726d5766f14..e352b0cd3a72c03c7d64d82d5559c5eac107619c 100644 (file)
@@ -296,6 +296,7 @@ int lv_reduce(struct logical_volume *lv, uint32_t extents)
        }
 
        lv->le_count = extents;
+       lv->size = extents * lv->vg->extent_size;
 
        return 1;
 }
@@ -325,6 +326,7 @@ int lv_extend(struct logical_volume *lv, uint32_t extents,
        memcpy(new_lv, lv, sizeof(*lv));
        new_lv->map = new_map;
        new_lv->le_count += extents;
+       new_lv->size += extents * lv->vg->extent_size;
 
        if (!_allocate(new_lv->vg, new_lv, acceptable_pvs, lv->le_count)) {
                stack;
index ff2295461a917240b4d83619be2884a306822313..44305d158e6ce4ec912b3ab5cb2fa1b383e5be14 100644 (file)
@@ -44,14 +44,17 @@ int lvchange(int argc, char **argv)
 
 static int lvchange_single(struct logical_volume *lv)
 {
-       char *vg_name;
        int doit = 0;
 
-       if (!(lv->vg->status & ACTIVE)) {
+/******* Removed requirement for VG to be active before making changes
+       if (!(lv->vg->status & ACTIVE) && 
+           !(arg_count(available_ARG) && 
+             strcmp(arg_str_value(available_ARG, "n"), "n"))) {
                log_error("Volume group %s must be active before changing a "
-                         "logical volume", vg_name);
+                         "logical volume", vg->name);
                return ECMD_FAILED;
        }
+********/
 
        if (lv->status & SNAPSHOT_ORG) {
                log_error("Can't change logical volume %s under snapshot",
@@ -84,8 +87,6 @@ static int lvchange_single(struct logical_volume *lv)
                return 0;
        }
 
-       /* FIXME activate change */
-
        log_print("Logical volume %s changed", lv->name);
 
        /* FIXME do_autobackup */
@@ -131,19 +132,12 @@ static int lvchange_permission(struct logical_volume *lv)
 static int lvchange_availability(struct logical_volume *lv)
 {
        int lv_stat = 0;
+       int active;
 
        if (strcmp(arg_str_value(available_ARG, "n"), "n"))
                lv_stat |= ACTIVE;
 
-       if ((lv_stat & ACTIVE) && (lv->status & ACTIVE)) {
-               log_error("Logical volume %s is already active", lv->name);
-               return 0;
-       }
-
-       if (!(lv_stat & ACTIVE) && !(lv->status & ACTIVE)) {
-               log_error("Logical volume %s is already not active", lv->name);
-               return 0;
-       }
+       active = lv_active(lv);
 
        if (lv_stat & ACTIVE) {
                lv->status |= ACTIVE;
@@ -153,19 +147,34 @@ static int lvchange_availability(struct logical_volume *lv)
                log_verbose("Deactivating logical volume %s", lv->name);
        }
 
-       log_very_verbose("Updating logical volume %s on disk(s)", lv->name);
-       if (!fid->ops->vg_write(fid, lv->vg))
-               return 0;
-
-       log_very_verbose("Updating %s in kernel", lv->name);
-       if (lv_stat & ACTIVE) {
-               if (!lv_activate(lv))
-                       return 0;
-       } else {
-               if (!lv_deactivate(lv))
+       if ((lv_stat & ACTIVE) && (lv->status & ACTIVE))
+               log_verbose("Logical volume %s is already active on disk", 
+                           lv->name);
+       else if (!(lv_stat & ACTIVE) && !(lv->status & ACTIVE))
+               log_verbose("Logical volume %s is already inactive on disk", 
+                           lv->name);
+       else {
+               log_very_verbose("Updating logical volume %s on disk(s)", 
+                                lv->name);
+               if (!fid->ops->vg_write(fid, lv->vg))
                        return 0;
        }
 
+       if ((lv_stat & ACTIVE) && (active & ACTIVE))
+               log_verbose("Logical volume %s is already active", lv->name);
+       else if (!(lv_stat & ACTIVE) && !(active & ACTIVE))
+               log_verbose("Logical volume %s is already inactive", lv->name);
+       else {
+               log_very_verbose("Updating %s in kernel", lv->name);
+               if (lv_stat & ACTIVE) {
+                       if (!lv_activate(lv))
+                               return 0;
+               } else {
+                       if (!lv_deactivate(lv))
+                               return 0;
+               }
+       }
+
        return 1;
 }
 
index 803a624cd4648e334da581c22929d1e4abf26d01..50abbe863d42a2a313ec7e640bb656fb334fe048 100644 (file)
@@ -115,11 +115,13 @@ int lvcreate(int argc, char **argv)
                return ECMD_FAILED;
        }
 
+/******* Removed check
        if (!(vg->status & ACTIVE)) {
                log_error("Volume group %s must be active before changing a "
                          "logical volume", vg_name);
                return ECMD_FAILED;
        }
+********/
 
        if (lv_name && (lvh = find_lv_in_vg(vg, lv_name))) {
                log_error("Logical volume %s already exists in "
index 929292609e76f4af4bba46ccc05c45c15e397299..8e82ce1bfe31bf8a475b508231c6e45d3ddf1134 100644 (file)
@@ -721,6 +721,7 @@ static int init(void)
 
        /* FIXME: Override from config file. (Append trailing slash if reqd) */
        cmd->dev_dir = "/dev/";
+       dm_set_dev_dir(cmd->dev_dir);
 
        if (!(cmd->cf = create_config_file())) {
                stack;
@@ -744,6 +745,8 @@ static int init(void)
                __init_log(cmd->cf);
        }
 
+       dm_log_init(print_log);
+
        if (!dev_cache_setup(cmd->cf)) {
                goto out;
        }
index f5987e606d2f77a3dd872dcf6e6f35265f87f0e3..697ce2a99eec88a182dbf3fdf3b27b5e371e0763 100644 (file)
@@ -37,11 +37,14 @@ static int lvremove_single(struct logical_volume *lv)
        struct volume_group *vg;
 
        vg = lv->vg;
+
+/******* Removed requirement
        if (!(vg->status & ACTIVE)) {
                log_error("Volume group %s must be active before removing a "
                          "logical volume", vg->name);
                return ECMD_FAILED;
        }
+********/
 
        if (lv->status & SNAPSHOT_ORG) {
                log_error("Can't remove logical volume %s under snapshot",
@@ -49,14 +52,11 @@ static int lvremove_single(struct logical_volume *lv)
                return ECMD_FAILED;
        }
 
-/********** FIXME  Ensure logical volume is not open on *any* machine
-       if (lv->open) {
-               log_error("can't remove open %s logical volume %s",
-                         lv->status & SNAPSHOT ? "snapshot" : "",
-                         lv->name);
+       /* FIXME Force option? */
+       if (lv_open_count(lv)) {
+               log_error("Can't remove open logical volume %s", lv->name);
                return ECMD_FAILED;
        }
-************/
 
        if (!arg_count(force_ARG)) {
                if (yes_no_prompt
@@ -67,6 +67,10 @@ static int lvremove_single(struct logical_volume *lv)
                }
        }
 
+       if (!lv_deactivate(lv)) {
+               log_error("Unable to deactivate logical volume %s", lv->name);
+       }
+
        log_verbose("Releasing logical volume %s", lv->name);
        if (!lv_remove(vg, lv)) {
                log_error("Error releasing logical volume %s", lv->name);
index 336e9c32d4b743a18225b195d22a7c4dfda60c45..f82da5f56c3d63fb1cb620b0185af59d501e65c3 100644 (file)
@@ -89,11 +89,13 @@ int lvrename(int argc, char **argv)
                return ECMD_FAILED;
        }
 
+/******* Removed requirement
        if (!(vg->status & ACTIVE)) {
                log_error("Volume group %s must be active before changing a "
                          "logical volume", vg_name);
                return ECMD_FAILED;
        }
+*******/
 
        if ((lvh = find_lv_in_vg(vg, lv_name_new))) {
                log_error("Logical volume %s already exists in "
@@ -120,7 +122,8 @@ int lvrename(int argc, char **argv)
                return ECMD_FAILED;
        }
 
-       /* FIXME Update symlink.  lv_reactivate? */
+       /* FIXME Update symlink. */
+       lv_reactivate(lv);
 
        /* FIXME backup */
 
index 9bc63c68e613c9f0df296d1497eb7529e49005e3..60e465ed21bfc8c9613a84bd4e8148e03c749afb 100644 (file)
@@ -95,11 +95,13 @@ int lvresize(int argc, char **argv)
                return ECMD_FAILED;
        }
 
+/******* Remove requirement 
        if (!(vg->status & ACTIVE)) {
                log_error("Volume group %s must be active before changing a "
                          "logical volume", vg_name);
                return ECMD_FAILED;
        }
+********/
 
        /* does LV exist? */
        if (!(lvh = find_lv_in_vg(vg, lv_name))) {
@@ -110,11 +112,13 @@ int lvresize(int argc, char **argv)
 
        lv = &list_item(lvh, struct lv_list)->lv;
 
+/******* Remove requirement
        if (!(lv->status & ACTIVE)) {
                log_error("Logical volume %s must be active before change",
                          lv_name);
                return ECMD_FAILED;
        }
+********/
 
        if (size) {
                /* No of 512-byte sectors */
@@ -196,7 +200,7 @@ int lvresize(int argc, char **argv)
                if (argc)
                        log_print("Ignoring PVs on command line when reducing");
 
-               if (lv->status & ACTIVE || lv_active(lv)) {
+               if (lv_active(lv)) {
                        dummy =
                            display_size(extents * vg->extent_size / 2,
                                         SIZE_SHORT);
index 29bad00bd4e0e8a65c590e7cdefd2df5c7a8fa3f..487aec2d5bee42d411fc654de6bf83bf4ca52cb9 100644 (file)
@@ -131,9 +131,11 @@ int pvchange_single(struct physical_volume *pv)
                pv->status &= ~ALLOCATED_PV;
        }
 
+/******* Ignore active
        if (!(pv->status & ACTIVE)) {
                log_verbose("Physical volume %s inactive", pv_name);
        }
+********/
 
        log_verbose("Updating physical volume %s", pv_name);
        if (*pv->vg_name) {
index 7f58cc78457792fce18b048d0f52bf5400d0cdca..7a008fd0251d4a3814ae053b994fdeff4c135e3b 100644 (file)
@@ -50,10 +50,12 @@ static int pvcreate_check(const char *name)
                return 0;
        }
 
+/******* Removed check
        if (pv->status & ACTIVE) {
                log_error("Can't create on active physical volume %s", name);
                return 0;
        }
+********/
 
        /* we must have -ff to overwrite a non orphan */
        if (arg_count(force_ARG) < 2) {
index 692ab51d0dabd0c189f3e0016ef790f834db8da6..a0c31d599b3b59f399c515ebf663ec38f94513e1 100644 (file)
@@ -78,20 +78,18 @@ static int vgchange_single(const char *vg_name)
 
 void vgchange_available(struct volume_group *vg)
 {
-       int lv_open;
-       struct list *pvh;
+       int lv_open, lv_active;
+       struct list *lvh;
        int available = !strcmp(arg_str_value(available_ARG, "n"), "y");
 
-       /* FIXME Kernel status to override disk flags ! */
-       if (available && (vg->status & ACTIVE)) {
-               log_error("Volume group '%s' is already active", vg->name);
-               return;
-       }
+       /* Ignore existing disk status */
+       if (available && (vg->status & ACTIVE))
+               log_verbose("Volume group %s is already active on disk", 
+                           vg->name);
 
-       if (!available && !(vg->status & ACTIVE)) {
-               log_error("Volume group '%s' is already not active", vg->name);
-               return;
-       }
+       if (!available && !(vg->status & ACTIVE))
+               log_verbose("Volume group %s is already inactive on disk", 
+                           vg->name);
 
        /* FIXME: Force argument to deactivate them? */
        if (!available && (lv_open = lvs_in_vg_opened(vg))) {
@@ -100,15 +98,19 @@ void vgchange_available(struct volume_group *vg)
                return;
        }
 
+       if (available && (lv_active = lvs_in_vg_activated(vg)))
+               log_verbose("%d logical volume(s) in volume group %s "
+                           "already active", lv_active, vg->name);
+
        if (available) {
                vg->status |= ACTIVE;
-               list_iterate(pvh, &vg->pvs)
-                       list_item(pvh, struct pv_list)->pv.status 
+               list_iterate(lvh, &vg->lvs)
+                       list_item(lvh, struct lv_list)->lv.status 
                                  |= ACTIVE;
        } else {
                vg->status &= ~ACTIVE;
-               list_iterate(pvh, &vg->pvs)
-                       list_item(pvh, struct pv_list)->pv.status 
+               list_iterate(lvh, &vg->lvs)
+                       list_item(lvh, struct lv_list)->lv.status 
                                  &= ~ACTIVE;
        }
 
@@ -117,13 +119,13 @@ void vgchange_available(struct volume_group *vg)
 
        if (available && (lv_open = activate_lvs_in_vg(vg)))
                log_verbose("Activated %d logical volumes in "
-                           "volume group '%s'", lv_open, vg->name);
+                           "volume group %s", lv_open, vg->name);
 
        if (!available && (lv_open = deactivate_lvs_in_vg(vg)))
                log_verbose("Deactivated %d logical volumes in "
-                           "volume group '%s'", lv_open, vg->name);
+                           "volume group %s", lv_open, vg->name);
 
-       log_print("Volume group %s successfully changed", vg->name);
+       log_print("Volume group %s updated", vg->name);
 
        return;
 }
index 1fa2c0f5823af49abd683783473ee07fba92b61b..e3847b4ae0a74a12e815aa3de26ae822bb7d04a1 100644 (file)
@@ -71,7 +71,7 @@ int vgcreate(int argc, char **argv)
                 return ECMD_FAILED;
         }
 
-       /* create the new vg */
+       /* Create the new VG */
        if (!(vg = vg_create(fid, vg_name, extent_size, max_pv, max_lv, 
                       argc - 1, argv + 1)))
                return ECMD_FAILED;
@@ -84,15 +84,11 @@ int vgcreate(int argc, char **argv)
                log_error("Warning: Setting maxphysicalvolumes to %d", 
                          vg->max_pv);
 
-       /* store vg on disk(s) */
+       /* Store VG on disk(s) */
        if (!fid->ops->vg_write(fid, vg))
                return ECMD_FAILED;
 
-       /* FIXME Create /dev/vg */
-       /* FIXME Activate */
-
-       log_print("Volume group %s successfully created and activated",
-                 vg_name);
+       log_print("Volume group %s successfully created", vg->name);
 
        return 0;
 }
index 0c3d100667e4cf99cf0367a0552eab67a1b9123f..f8d012285d5eb652e8308a85b80e054f89ff70f9 100644 (file)
@@ -46,10 +46,10 @@ int vgextend(int argc, char **argv)
                return ECMD_FAILED;
        }
 
-       if (!(vg->status & ACTIVE)) {
+/******* Ignore active
+       if (!(vg->status & ACTIVE))
                log_error("Volume group '%s' is not active.", vg_name);
-               return ECMD_FAILED;
-       }
+********/
 
        if (!(vg->status & EXTENDABLE_VG)) {
                log_error("Volume group '%s' is not extendable.", vg_name);
index 3223615ab0f1d89fc79a7478524e67232ecc3fe6..b284c3adf704dfcea0a2d23a38bb4a31e4d7a96c 100644 (file)
@@ -54,10 +54,12 @@ int vgreduce(int argc, char **argv)
                return ECMD_FAILED;
        }
 
+/******* Ignore active status
        if (!(vg->status & ACTIVE)) {
                log_error("Volume group %s is not active", vg_name);
                return ECMD_FAILED;
        }
+*******/
 
        if (!(vg->status & EXTENDABLE_VG)) {
                log_error("Volume group %s is not reducable", vg_name);
index 944685cceab200a606b9b84df1ae6c2056d8e496..7b4cdd45647cd4aaccdd3539253a33d9c425f211 100644 (file)
@@ -40,10 +40,12 @@ static int vgremove_single(const char *vg_name)
                return ECMD_FAILED;
        }
 
+/******* Ignore active status
        if (vg->status & ACTIVE) {
                log_error("Volume group %s is still active", vg_name);
                return ECMD_FAILED;
        }
+********/
 
        if (vg->lv_count) {
                log_error("Volume group %s still contains %d logical volume(s)",
index b700a8d34f71396a39780109e43a939f7a5fa879..647e1fb97afd64d62e29193217773f31ade0c3bf 100644 (file)
@@ -118,6 +118,8 @@ int vgrename(int argc, char **argv)
                return ECMD_FAILED;
        }
 
+/******* FIXME Any LV things to update? */
+
 /*********** 
        if ((ret = do_autobackup(vg_name_new, vg_old)))
                return ECMD_FAILED;
index b7435bbe8eae1a60835777d08eeb5e615ec334ee..420fa29d83e2385386e2fbe1c0d180481300e3db 100644 (file)
@@ -50,20 +50,22 @@ static int vgscan_single(const char *vg_name)
        log_print("Found %sactive volume group %s",
                  (vg->status & ACTIVE) ? "" : "in", vg_name);
 
+/******* Ignore active flag
        if (!(vg->status & ACTIVE)) {
+               return 0;
                vg->status |= ACTIVE;
                if (!(fid->ops->vg_write(fid, vg))) {
                        log_error("Failed to activate volume group %s",
                                  vg_name);
                        return ECMD_FAILED;
                }
-
        }
+*********/
 
-       /* FIXME: Creates /dev/vg */
-       activate_lvs_in_vg(vg);
+       
 
-       log_print("Volume Group %s activated", vg_name);
+       log_print("%d logical volumes in volume group %s activated", 
+                 activate_lvs_in_vg(vg), vg_name);
 
        return 0;
 }
This page took 0.067198 seconds and 5 git commands to generate.