master - lv_remove_single: add silent arg
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5a6794a2ce74416c399f8cf28f2625de8ba9cd55 Commit: 5a6794a2ce74416c399f8cf28f2625de8ba9cd55 Parent: 84b3852ee5ed6d6a254ec4ffa9254db034c902bc Author: Zdenek Kabelac <[email protected]> AuthorDate: Fri Nov 29 17:00:55 2013 +0100 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Wed Dec 4 14:30:25 2013 +0100
lv_remove_single: add silent arg
Support silence for removal message.
--- WHATS_NEW | 1 + lib/metadata/lv_manip.c | 6 +++--- lib/metadata/metadata-exported.h | 2 +- liblvm/lvm_lv.c | 2 +- tools/lvconvert.c | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.105 - ===================================== + Extend lv_remove_single() to not print info about removed LV. Replace open_count check with lv_check_not_in_use() for snapshot open test. Add error messages with LV names for failing lv refresh. Compile/link daemons with RELRO and PIE options to harden daemon security.
lib/metadata/lv_manip.c +3 -3
@@ -4482,7 +4482,7 @@ void lv_set_hidden(struct logical_volume *lv) }int lv_remove_single (struct cmd_context *cmd,struct logical_volume *lv, -const force_t force) +force_t force,int silent) {struct volume_group *vg;struct lvinfo info;
@@ -4639,7 +4639,7 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,backup (vg); -if (visible) +if (!silent && visible)log_print_unless_silent ("Logical volume \"%s\" successfully removed" , lv->name);return 1 ;
@@ -4764,7 +4764,7 @@ int lv_remove_with_dependencies(struct cmd_context *cmd, struct logical_volume * "to a thin pool. Proceed? [y/n]: ", lv->name) == 'n')) goto no_remove; -return lv_remove_single (cmd, lv, force); +return lv_remove_single (cmd, lv, force,0 ); no_remove:log_error ("Logical volume \"%s\" not removed." , lv->name);
lib/metadata/metadata-exported.h +1 -1
@@ -657,7 +657,7 @@ int lv_extend(struct logical_volume *lv,int lv_remove (struct logical_volume *lv);int lv_remove_single (struct cmd_context *cmd,struct logical_volume *lv, -force_t force); +force_t force,int silent);int lv_remove_with_dependencies (struct cmd_context *cmd,struct logical_volume *lv,force_t force,unsigned level);
liblvm/lvm_lv.c +1 -1
@@ -206,7 +206,7 @@ int lvm_vg_remove_lv(lv_t lv)return -1 ;if (!vg_check_write_mode (lv->vg))return -1 ; -if (!lv_remove_single (lv->vg->cmd, lv,DONT_PROMPT )) +if (!lv_remove_single (lv->vg->cmd, lv,DONT_PROMPT ,0 ))return -1 ;return 0 ; }
tools/lvconvert.c +1 -1
@@ -683,7 +683,7 @@ static int _finish_lvconvert_merge(struct cmd_context *cmd, }log_print_unless_silent ("Merge of snapshot into logical volume %s has finished." , lv->name); -if (!lv_remove_single (cmd, snap_seg->cow,DONT_PROMPT )) { +if (!lv_remove_single (cmd, snap_seg->cow,DONT_PROMPT ,0 )) {log_error ("Could not remove snapshot %s merged into %s." , snap_seg->cow->name, lv->name);return 0 ;