summaryrefslogtreecommitdiffstats
path: root/tools/lvchange.c
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2011-01-24 13:38:31 +0000
committerAlasdair Kergon <agk@redhat.com>2011-01-24 13:38:31 +0000
commitb51cd542becd76248fff2395ea84d47ff10ce1a8 (patch)
tree942be304484975f673dcae4e7a7768249edc0ae0 /tools/lvchange.c
parent74863007ee2230e71a2ee75e2c67965e2568e796 (diff)
downloadlvm2-b51cd542becd76248fff2395ea84d47ff10ce1a8.tar.gz
lvm2-b51cd542becd76248fff2395ea84d47ff10ce1a8.tar.xz
lvm2-b51cd542becd76248fff2395ea84d47ff10ce1a8.zip
Add change_tag to toollib.
Allow multiple pvchange command line options to be specified together.
Diffstat (limited to 'tools/lvchange.c')
-rw-r--r--tools/lvchange.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/tools/lvchange.c b/tools/lvchange.c
index 8161d227..f3b1e767 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -491,24 +491,10 @@ static int lvchange_persistent(struct cmd_context *cmd,
return 1;
}
-static int lvchange_tag(struct cmd_context *cmd, struct logical_volume *lv,
- int arg)
+static int lvchange_tag(struct cmd_context *cmd, struct logical_volume *lv, int arg)
{
- const char *tag;
- struct arg_value_group_list *current_group;
-
- dm_list_iterate_items(current_group, &cmd->arg_value_groups) {
- if (!grouped_arg_is_set(current_group->arg_values, arg))
- continue;
-
- if (!(tag = grouped_arg_str_value(current_group->arg_values, arg, NULL))) {
- log_error("Failed to get tag");
- return 0;
- }
-
- if (!lv_change_tag(lv, tag, arg == addtag_ARG))
- return_0;
- }
+ if (!change_tag(cmd, NULL, lv, NULL, arg))
+ return_0;
log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name);