mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
lv_remove_single: add silent arg
Support silence for removal message.
This commit is contained in:
parent
84b3852ee5
commit
5a6794a2ce
@ -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.
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user