diff options
author | Alasdair Kergon <agk@redhat.com> | 2011-01-24 13:38:31 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2011-01-24 13:38:31 +0000 |
commit | b51cd542becd76248fff2395ea84d47ff10ce1a8 (patch) | |
tree | 942be304484975f673dcae4e7a7768249edc0ae0 /tools/vgchange.c | |
parent | 74863007ee2230e71a2ee75e2c67965e2568e796 (diff) | |
download | lvm2-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/vgchange.c')
-rw-r--r-- | tools/vgchange.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/tools/vgchange.c b/tools/vgchange.c index bf7ebd8f..f2d399c4 100644 --- a/tools/vgchange.c +++ b/tools/vgchange.c @@ -360,37 +360,14 @@ static int _vgchange_pesize(struct cmd_context *cmd, struct volume_group *vg) return 1; } -static int _vgchange_tag(struct cmd_context *cmd, struct volume_group *vg, - 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 (!vg_change_tag(vg, tag, arg == addtag_ARG)) - return_0; - - } - - return 1; -} - static int _vgchange_addtag(struct cmd_context *cmd, struct volume_group *vg) { - return _vgchange_tag(cmd, vg, addtag_ARG); + return change_tag(cmd, vg, NULL, NULL, addtag_ARG); } static int _vgchange_deltag(struct cmd_context *cmd, struct volume_group *vg) { - return _vgchange_tag(cmd, vg, deltag_ARG); + return change_tag(cmd, vg, NULL, NULL, deltag_ARG); } static int _vgchange_uuid(struct cmd_context *cmd __attribute__((unused)), |