diff options
author | David Teigland <teigland@redhat.com> | 2014-04-17 13:15:55 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2014-04-17 13:15:55 -0500 |
commit | b0e6d2cba0a44da0aa4207649b17fbd4bf49ed6a (patch) | |
tree | c4763f2973a4ba998f1cf837531303e94ab144cf | |
parent | 8f9c3135e162f7346e840f5b47b7466765f79bb2 (diff) | |
download | lvm2-dev-dct-process-v12.tar.gz |
vgreduce: report an error if a pv is not founddev-dct-process-v12
When a pv is explicitly named for reduce, and is
not found in the vg, report and return an error.
-rw-r--r-- | tools/toollib.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/toollib.c b/tools/toollib.c index 4681abbac..48a5c1647 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -2032,6 +2032,7 @@ int process_each_pv(struct cmd_context *cmd, struct dm_list arg_pvnames; /* str_list */ struct dm_list all_vgnames; /* name_id_list */ struct dm_list all_devs; /* device_list */ + struct str_list *sl; int process_all_pvs; int process_all_devs; int ret_max = ECMD_PROCESSED; @@ -2062,9 +2063,16 @@ int process_each_pv(struct cmd_context *cmd, * process pvs (all pvs, or named pvs, or pvs with matching tags). */ if (vg) { - return process_pvs_in_vg(cmd, vg, NULL, - &arg_pvnames, &arg_tags, process_all_pvs, - handle, process_single_pv); + ret = process_pvs_in_vg(cmd, vg, NULL, + &arg_pvnames, &arg_tags, process_all_pvs, + handle, process_single_pv); + + dm_list_iterate_items(sl, &arg_pvnames) { + log_error("Physical Volume \"%s\" not found in Volume Group \"%s\"", + sl->str, vg->name); + ret = ECMD_FAILED; + } + return ret; } /* |