From 8ff2e245acb6ed843f2ee6f5b3944691b7a89c41 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 7 Sep 2011 08:41:47 +0000 Subject: [PATCH] Support break for vgchange and vgrefresh operation Allow to break some lengthy vgchange and vgrefresh operation. --- WHATS_NEW | 1 + tools/toollib.c | 9 ++++++++- tools/vgchange.c | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW b/WHATS_NEW index a9bb2b434..f31ea7d9e 100644 --- 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. diff --git a/tools/toollib.c b/tools/toollib.c index 49c94244f..d0dffa1a5 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -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; } diff --git a/tools/vgchange.c b/tools/vgchange.c index 5deb12983..f36f27d4f 100644 --- a/tools/vgchange.c +++ b/tools/vgchange.c @@ -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)? -- 2.43.5