mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
lvm2app: lvm_vg_list_lvs filter hidden LVs
The function lvm_vg_list_lvs was returning all logical volumes, including *_tmeta and *_tdata. Added check to verify that LV is visible before including in list of returned logical volumes. Signed-off-by: Tony Asleson <tasleson@redhat.com>
This commit is contained in:
parent
31de670318
commit
a2b5147600
@ -250,6 +250,7 @@ struct dm_list *lvm_vg_list_lvs(vg_t vg)
|
||||
dm_list_init(list);
|
||||
|
||||
dm_list_iterate_items(lvl, &vg->lvs) {
|
||||
if (lv_is_visible(lvl->lv)) {
|
||||
if (!(lvs = dm_pool_zalloc(vg->vgmem, sizeof(*lvs)))) {
|
||||
log_errno(ENOMEM,
|
||||
"Memory allocation fail for lvm_lv_list.");
|
||||
@ -258,6 +259,7 @@ struct dm_list *lvm_vg_list_lvs(vg_t vg)
|
||||
lvs->lv = lvl->lv;
|
||||
dm_list_add(list, &lvs->list);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user