From 178e1df257026b25a099930cf33711b85bace271 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Wed, 9 Apr 2008 12:45:32 +0000 Subject: [PATCH] Fix some pvmove error status codes. --- WHATS_NEW | 1 + tools/polldaemon.h | 24 ++++++++++++------------ tools/pvmove.c | 9 +++++---- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 030a4e8b2..0f1314749 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.34 - =================================== + Fix some pvmove error status codes. Fix vgsplit error paths to release vg_to lock. Indicate whether or not VG is clustered in vgcreate log message. Mention default --clustered setting in vgcreate man page. diff --git a/tools/polldaemon.h b/tools/polldaemon.h index 3b5ffa3cc..197f02f27 100644 --- a/tools/polldaemon.h +++ b/tools/polldaemon.h @@ -19,21 +19,21 @@ #include "metadata-exported.h" struct poll_functions { - const char *(*get_copy_name_from_lv) (struct logical_volume * lv_mirr); - struct volume_group *(*get_copy_vg) (struct cmd_context * cmd, + const char *(*get_copy_name_from_lv) (struct logical_volume *lv_mirr); + struct volume_group *(*get_copy_vg) (struct cmd_context *cmd, const char *name); - struct logical_volume *(*get_copy_lv) (struct cmd_context * cmd, - struct volume_group * vg, + struct logical_volume *(*get_copy_lv) (struct cmd_context *cmd, + struct volume_group *vg, const char *name, uint32_t lv_type); - int (*update_metadata) (struct cmd_context * cmd, - struct volume_group * vg, - struct logical_volume * lv_mirr, - struct list * lvs_changed, int first_time); - int (*finish_copy) (struct cmd_context * cmd, - struct volume_group * vg, - struct logical_volume * lv_mirr, - struct list * lvs_changed); + int (*update_metadata) (struct cmd_context *cmd, + struct volume_group *vg, + struct logical_volume *lv_mirr, + struct list *lvs_changed, int first_time); + int (*finish_copy) (struct cmd_context *cmd, + struct volume_group *vg, + struct logical_volume *lv_mirr, + struct list *lvs_changed); }; struct daemon_parms { diff --git a/tools/pvmove.c b/tools/pvmove.c index 7a14a8d4f..e5ee697f3 100644 --- a/tools/pvmove.c +++ b/tools/pvmove.c @@ -565,8 +565,10 @@ int pvmove(struct cmd_context *cmd, int argc, char **argv) char *colon; int ret; - if (!pvmove_target_present(cmd, 0)) - return 0; + if (!pvmove_target_present(cmd, 0)) { + stack; + return ECMD_FAILED; + } if (argc) { pv_name = argv[0]; @@ -577,7 +579,7 @@ int pvmove(struct cmd_context *cmd, int argc, char **argv) (unsigned) (colon - pv_name)))) { log_error("Failed to clone PV name"); - return 0; + return ECMD_FAILED; } } @@ -587,7 +589,6 @@ int pvmove(struct cmd_context *cmd, int argc, char **argv) stack; return ret; } - } return pvmove_poll(cmd, pv_name,