/*
* is it an orphan ?
*/
- if (data->pvd.vg_name == '\0') {
+ if (!*data->pvd.vg_name) {
log_very_verbose("%s is not a member of any VG", name);
- return data;
+ return (vg_name) ? NULL : data;
}
if (vg_name && strcmp(vg_name, data->pvd.vg_name)) {
* FIXME: Quick hack. We can use caching to
* prevent a total re-read, even so vg_number
* causes the tools to check *every* pv. Yuck.
- * Put in seperate file so it wouldn't contaminate
+ * Put in separate file so it wouldn't contaminate
* other code.
*/
int get_free_vg_number(struct dev_filter *filter, const char *candidate_vg,
list_iterate(pvh, &all_pvs) {
dl = list_item(pvh, struct disk_list);
- if (!strcmp(dl->pvd.vg_name, candidate_vg))
+ if (!*dl->pvd.vg_name ||
+ !strcmp(dl->pvd.vg_name, candidate_vg))
continue;
numbers[dl->vgd.vg_number] = 1;
struct device *dev;
char *name;
- if (!(name = dbg_malloc(PATH_MAX))) {
+ if (!(name = pool_alloc(fid->cmd->mem, PATH_MAX))) {
log_error("Name allocation failed - device not zeroed");
return ECMD_FAILED;
}
}
if (!*pv->vg_name) {
- log_print("PV %-*s is in no VG %-*s [%s]",
+ log_print("PV %-*s %-*s [%s]",
pv_max_name_len, pv_tmp_name,
- vg_max_name_len - 6, " ",
+ vg_max_name_len, " ",
(s1 = display_size(pv->size / 2, SIZE_SHORT)));
dbg_free(s1);
return;
sprintf(vg_tmp_name, "%s", pv->vg_name);
log_print
- ("PV %-*s of VG %-*s [%s / %s free]", pv_max_name_len,
+ ("PV %-*s VG %-*s [%s / %s free]", pv_max_name_len,
pv_tmp_name, vg_max_name_len, vg_tmp_name,
(s1 = display_size(pv->pe_count * pv->pe_size / 2, SIZE_SHORT)),
(s2 =