summaryrefslogtreecommitdiffstats
path: root/liblvm
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2010-02-03 14:08:39 +0000
committerPeter Rajnoha <prajnoha@redhat.com>2010-02-03 14:08:39 +0000
commit04fa77c3be1634ccdb8bf03b45effb04eaad8523 (patch)
treec9e0b814f9a14eb4d3a8bf64aa6443cfecc241a8 /liblvm
parent5bc2af2688e8ea1926a8bd0ce49aab4bcfad56ae (diff)
downloadlvm2-04fa77c3be1634ccdb8bf03b45effb04eaad8523.tar.gz
lvm2-04fa77c3be1634ccdb8bf03b45effb04eaad8523.tar.xz
lvm2-04fa77c3be1634ccdb8bf03b45effb04eaad8523.zip
This is related to liblvm and its lvm_list_vg_names() and lvm_list_vg_uuids() functions
where we should not expose internal VG names/uuids (the ones with "#" prefix )through the interface. Otherwise, we could end up with library users opening internal VGs which will initiate locking mechanism that won't be cleaned up properly. "#orphans_{lvm1, lvm2, pool}" names are treated in a special way, they are truncated first to "orphans" and this is used as a part of the lock name then (e.g. while calling lvm_vg_open()). When library user calls lvm_vg_close(), the original name "orphans_{lvm1, lvm2, pool}" is used directly and therefore no unlock occurs. We should exclude internal VG names and uuids in the lists provided by lvmcache: lvmcache_get_vgids() and lvmcache_get_vgnames().
Diffstat (limited to 'liblvm')
-rw-r--r--liblvm/lvm_vg.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/liblvm/lvm_vg.c b/liblvm/lvm_vg.c
index 4addc1cf..9a5c2392 100644
--- a/liblvm/lvm_vg.c
+++ b/liblvm/lvm_vg.c
@@ -315,19 +315,14 @@ char *lvm_vg_get_name(const vg_t vg)
return name;
}
-/*
- * FIXME: These functions currently return hidden VGs. We should either filter
- * these out and not return them in the list, or export something like
- * is_orphan_vg and tell the caller to filter.
- */
struct dm_list *lvm_list_vg_names(lvm_t libh)
{
- return get_vgnames((struct cmd_context *)libh, 0);
+ return get_vgnames((struct cmd_context *)libh, 0, 0);
}
struct dm_list *lvm_list_vg_uuids(lvm_t libh)
{
- return get_vgids((struct cmd_context *)libh, 0);
+ return get_vgids((struct cmd_context *)libh, 0, 0);
}
/*