1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-25 18:50:51 +03:00

Fix tools to report error when stopped by user.

(And do not produce internal error message.)
This commit is contained in:
Milan Broz 2009-12-03 19:18:33 +00:00
parent 60184834b5
commit fec4de9563
9 changed files with 10 additions and 9 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.57 -
====================================
Fix tools to use log_error when stopped by user.
Fix lvcreate --readahead.
Fix clvmd memory leak in lv_info_by_lvid.
Do not allow creating mirrors of more than 8 images.

View File

@ -317,7 +317,7 @@ static void _display_archive(struct cmd_context *cmd, struct archive_file *af)
*/
/* FIXME Use variation on _vg_read */
if (!(vg = text_vg_import_file(tf, af->path, &when, &desc))) {
log_print("Unable to read archive file.");
log_error("Unable to read archive file.");
tf->fmt->ops->destroy_instance(tf);
return;
}

View File

@ -2103,7 +2103,7 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
"%slogical volume %s? [y/n]: ",
vg_is_clustered(vg) ? "clustered " : "",
lv->name) == 'n') {
log_print("Logical volume %s not removed", lv->name);
log_error("Logical volume %s not removed", lv->name);
return 0;
}
}

View File

@ -1223,7 +1223,7 @@ static int pvcreate_check(struct cmd_context *cmd, const char *name,
/* prompt */
if (pv && !is_orphan(pv) && !pp->yes &&
yes_no_prompt(_really_init, name, pv_vg_name(pv)) == 'n') {
log_print("%s: physical volume not initialized", name);
log_error("%s: physical volume not initialized", name);
return 0;
}

View File

@ -183,7 +183,7 @@ static int lvchange_resync(struct cmd_context *cmd,
yes_no_prompt("Do you really want to deactivate "
"logical volume %s to resync it? [y/n]: ",
lv->name) == 'n') {
log_print("Logical volume \"%s\" not resynced",
log_error("Logical volume \"%s\" not resynced",
lv->name);
return 0;
}
@ -433,7 +433,7 @@ static int lvchange_persistent(struct cmd_context *cmd,
yes_no_prompt("Logical volume %s will be "
"deactivated temporarily. "
"Continue? [y/n]: ", lv->name) == 'n') {
log_print("%s device number not changed.",
log_error("%s device number not changed.",
lv->name);
return 0;
}

View File

@ -18,6 +18,6 @@
int lvmchange(struct cmd_context *cmd __attribute((unused)),
int argc __attribute((unused)), char **argv __attribute((unused)))
{
log_print("With LVM2 and the device mapper, this program is obsolete.");
log_error("With LVM2 and the device mapper, this program is obsolete.");
return ECMD_FAILED;
}

View File

@ -120,7 +120,7 @@ static int _request_confirmation(struct cmd_context *cmd,
if (!arg_count(cmd, force_ARG)) {
if (yes_no_prompt("Do you really want to reduce %s? [y/n]: ",
lp->lv_name) == 'n') {
log_print("Logical volume %s NOT reduced", lp->lv_name);
log_error("Logical volume %s NOT reduced", lp->lv_name);
return 0;
}
if (sigint_caught())

View File

@ -74,7 +74,7 @@ static int pvremove_check(struct cmd_context *cmd, const char *name)
/* prompt */
if (!arg_count(cmd, yes_ARG) &&
yes_no_prompt(_really_wipe, name, pv_vg_name(pv)) == 'n') {
log_print("%s: physical volume label not removed", name);
log_error("%s: physical volume label not removed", name);
return 0;
}

View File

@ -36,7 +36,7 @@ static int vgremove_single(struct cmd_context *cmd, const char *vg_name,
"group \"%s\" containing %u "
"logical volumes? [y/n]: ",
vg_name, lv_count) == 'n')) {
log_print("Volume group \"%s\" not removed", vg_name);
log_error("Volume group \"%s\" not removed", vg_name);
return ECMD_FAILED;
}
if (!remove_lvs_in_vg(cmd, vg, force)) {