diff options
author | David Teigland <teigland@redhat.com> | 2014-04-17 13:15:55 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2014-04-22 13:44:49 -0500 |
commit | 5d4360b53bd0f3d0e99ad7d25c7894573e4a571a (patch) | |
tree | ae25dc7a7c5f9981bc40e3e243d0484f0101279a | |
parent | aa201f76372eed19a6edf57501fd239f048f943d (diff) | |
download | lvm2-5d4360b53bd0f3d0e99ad7d25c7894573e4a571a.tar.gz |
vgreduce: report an error if a pv is not found
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; } /* |