]> sourceware.org Git - lvm2.git/commitdiff
Support break for vgchange and vgrefresh operation
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 7 Sep 2011 08:41:47 +0000 (08:41 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 7 Sep 2011 08:41:47 +0000 (08:41 +0000)
Allow to break some lengthy vgchange and vgrefresh operation.

WHATS_NEW
tools/toollib.c
tools/vgchange.c

index a9bb2b434daa8f09c2e0d3183a9449f45f79930e..f31ea7d9e2080a515bf6d11db33afcdd179c24ad 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Support break for vgchange and vgrefresh operation.
   Switch int to unsigned type for pvmetadatacopies for pv_create().
   Replace :space: with [\t ] for awk in vgimportclone (not widely supported).
   Begin using 64-bit status field flags.
index 49c94244f2592dd0023439926a8d53b93b473e42..d0dffa1a56d7fbc6ca3b37b154123254993f7756 100644 (file)
@@ -1323,10 +1323,17 @@ int vg_refresh_visible(struct cmd_context *cmd, struct volume_group *vg)
        struct lv_list *lvl;
        int r = 1;
 
-       dm_list_iterate_items(lvl, &vg->lvs)
+       sigint_allow();
+       dm_list_iterate_items(lvl, &vg->lvs) {
+               if (sigint_caught())
+                       return_0;
+
                if (lv_is_visible(lvl->lv))
                        if (!lv_refresh(cmd, lvl->lv))
                                r = 0;
+       }
+
+       sigint_restore();
 
        return r;
 }
index 5deb12983bb7a16d65c186d681a975544331c81a..f36f27d4fe6a325db49f73ee6037b7174677f50f 100644 (file)
@@ -90,7 +90,11 @@ static int _activate_lvs_in_vg(struct cmd_context *cmd,
        struct logical_volume *lv;
        int count = 0, expected_count = 0;
 
+       sigint_allow();
        dm_list_iterate_items(lvl, &vg->lvs) {
+               if (sigint_caught())
+                       return_0;
+
                lv = lvl->lv;
 
                if (!lv_is_visible(lv))
@@ -160,6 +164,8 @@ static int _activate_lvs_in_vg(struct cmd_context *cmd,
                count++;
        }
 
+       sigint_restore();
+
        if (expected_count)
                log_verbose("%s %d logical volumes in volume group %s",
                            (activate == CHANGE_AN || activate == CHANGE_ALN)?
This page took 0.041613 seconds and 5 git commands to generate.