summaryrefslogtreecommitdiff
path: root/tools/pvcreate.c
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2013-02-18 10:51:32 +0100
committerPeter Rajnoha <prajnoha@redhat.com>2013-02-26 11:24:38 +0100
commit6692b177777501532ba0d422dcb2a22016405519 (patch)
tree93b073b34f5992e8661edf20dde6d94d1db71f25 /tools/pvcreate.c
parent71f49345004d385acc71a8e534c4313069cc59b6 (diff)
downloadlvm2-6692b177777501532ba0d422dcb2a22016405519.tar.gz
cleanup: add struct pvcreate_restorable_params and move relevant items from pvcreate_params
Extract restorable PV creation parameters from struct pvcreate_params into a separate struct pvcreate_restorable_params for clarity and also for better maintainability when adding any new items later.
Diffstat (limited to 'tools/pvcreate.c')
-rw-r--r--tools/pvcreate.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/pvcreate.c b/tools/pvcreate.c
index c75f5619b..d7e7e5245 100644
--- a/tools/pvcreate.c
+++ b/tools/pvcreate.c
@@ -53,29 +53,29 @@ static int pvcreate_restore_params_validate(struct cmd_context *cmd,
if (arg_count(cmd, uuidstr_ARG)) {
uuid = arg_str_value(cmd, uuidstr_ARG, "");
- if (!id_read_format(&pp->id, uuid))
+ if (!id_read_format(&pp->rp.id, uuid))
return 0;
- pp->idp = &pp->id;
+ pp->rp.idp = &pp->rp.id;
lvmcache_seed_infos_from_lvmetad(cmd); /* need to check for UUID dups */
}
if (arg_count(cmd, restorefile_ARG)) {
- pp->restorefile = arg_str_value(cmd, restorefile_ARG, "");
+ pp->rp.restorefile = arg_str_value(cmd, restorefile_ARG, "");
/* The uuid won't already exist */
- if (!(vg = backup_read_vg(cmd, NULL, pp->restorefile))) {
+ if (!(vg = backup_read_vg(cmd, NULL, pp->rp.restorefile))) {
log_error("Unable to read volume group from %s",
- pp->restorefile);
+ pp->rp.restorefile);
return 0;
}
- if (!(existing_pvl = find_pv_in_vg_by_uuid(vg, pp->idp))) {
+ if (!(existing_pvl = find_pv_in_vg_by_uuid(vg, pp->rp.idp))) {
release_vg(vg);
log_error("Can't find uuid %s in backup file %s",
- uuid, pp->restorefile);
+ uuid, pp->rp.restorefile);
return 0;
}
- pp->pe_start = pv_pe_start(existing_pvl->pv);
- pp->extent_size = pv_pe_size(existing_pvl->pv);
- pp->extent_count = pv_pe_count(existing_pvl->pv);
+ pp->rp.pe_start = pv_pe_start(existing_pvl->pv);
+ pp->rp.extent_size = pv_pe_size(existing_pvl->pv);
+ pp->rp.extent_count = pv_pe_count(existing_pvl->pv);
release_vg(vg);
}