int vg_remove(struct volume_group *vg);
int vg_rename(struct cmd_context *cmd, struct volume_group *vg,
const char *new_name);
-int vg_extend(struct volume_group *vg, int pv_count, char **pv_names);
+int vg_extend(struct volume_group *vg, int pv_count, char **pv_names,
+ struct pvcreate_params *pp);
int vg_reduce(struct volume_group *vg, char *pv_name);
int vg_set_extent_size(struct volume_group *vg, uint32_t new_extent_size);
int vg_set_max_lv(struct volume_group *vg, uint32_t max_lv);
return 1;
}
-int vg_extend(struct volume_group *vg, int pv_count, char **pv_names)
+/*
+ * Extend a VG by a single PV / device path
+ *
+ * Parameters:
+ * - vg: handle of volume group to extend by 'pv_name'
+ * - pv_count: count of device paths of PVs
+ * - pv_names: device paths of PVs to add to VG
+ * - pp: parameters to pass to implicit pvcreate; if NULL, do not pvcreate
+ *
+ */
+int vg_extend(struct volume_group *vg, int pv_count, char **pv_names,
+ struct pvcreate_params *pp)
{
int i;
/* attach each pv */
for (i = 0; i < pv_count; i++) {
- if (!vg_extend_single_pv(vg, pv_names[i], NULL))
+ if (!vg_extend_single_pv(vg, pv_names[i], pp))
goto bad;
}
return -1;
}
- if (!vg_extend(vg, 1, (char **) &device)) {
+ if (!vg_extend(vg, 1, (char **) &device, NULL)) {
unlock_vg(vg->cmd, VG_ORPHANS);
return -1;
}
}
/* attach the pv's */
- if (!vg_extend(vg, argc - 1, argv + 1))
+ if (!vg_extend(vg, argc - 1, argv + 1, NULL))
goto_bad;
if (vp_new.max_lv != vg->max_lv)
goto_bad;
/* extend vg */
- if (!vg_extend(vg, argc, argv))
+ if (!vg_extend(vg, argc, argv, NULL))
goto_bad;
/* ret > 0 */