diff options
author | Alasdair G Kergon <agk@redhat.com> | 2016-06-21 22:24:52 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2016-06-21 22:24:52 +0100 |
commit | 7e671e5dd0af699244902d5ce71a7159253c9e2b (patch) | |
tree | ce14c9ff42cc60f8255a735dcae8f3e34ca1775e /tools/pvcreate.c | |
parent | 6c269e639a121329fc035685f944816a763b23cf (diff) | |
download | lvm2-7e671e5dd0af699244902d5ce71a7159253c9e2b.tar.gz |
tools: Use arg_is_set instead of arg_count.
Diffstat (limited to 'tools/pvcreate.c')
-rw-r--r-- | tools/pvcreate.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/pvcreate.c b/tools/pvcreate.c index ae133fa74..fe6611f03 100644 --- a/tools/pvcreate.c +++ b/tools/pvcreate.c @@ -27,25 +27,25 @@ static int pvcreate_restore_params_from_args(struct cmd_context *cmd, int argc, { pp->restorefile = arg_str_value(cmd, restorefile_ARG, NULL); - if (arg_count(cmd, restorefile_ARG) && !arg_count(cmd, uuidstr_ARG)) { + if (arg_is_set(cmd, restorefile_ARG) && !arg_is_set(cmd, uuidstr_ARG)) { log_error("--uuid is required with --restorefile"); return 0; } - if (!arg_count(cmd, restorefile_ARG) && arg_count(cmd, uuidstr_ARG)) { - if (!arg_count(cmd, norestorefile_ARG) && + if (!arg_is_set(cmd, restorefile_ARG) && arg_is_set(cmd, uuidstr_ARG)) { + if (!arg_is_set(cmd, norestorefile_ARG) && find_config_tree_bool(cmd, devices_require_restorefile_with_uuid_CFG, NULL)) { log_error("--restorefile is required with --uuid"); return 0; } } - if (arg_count(cmd, uuidstr_ARG) && argc != 1) { + if (arg_is_set(cmd, uuidstr_ARG) && argc != 1) { log_error("Can only set uuid on one volume at once"); return 0; } - if (arg_count(cmd, uuidstr_ARG)) { + if (arg_is_set(cmd, uuidstr_ARG)) { pp->uuid_str = arg_str_value(cmd, uuidstr_ARG, ""); if (!id_read_format(&pp->pva.id, pp->uuid_str)) return 0; @@ -58,7 +58,7 @@ static int pvcreate_restore_params_from_args(struct cmd_context *cmd, int argc, } pp->pva.size = arg_uint64_value(cmd, physicalvolumesize_ARG, UINT64_C(0)); - if (arg_count(cmd, restorefile_ARG) || arg_count(cmd, uuidstr_ARG)) + if (arg_is_set(cmd, restorefile_ARG) || arg_is_set(cmd, uuidstr_ARG)) pp->zero = 0; return 1; } |