1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvm2app: Add method to retrieve attr from lv.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
This commit is contained in:
Tony Asleson 2013-04-10 14:37:56 -04:00
parent 588a16cadb
commit 952605a8ea
2 changed files with 21 additions and 0 deletions

View File

@ -1215,6 +1215,22 @@ const char *lvm_lv_get_uuid(const lv_t lv);
*/
const char *lvm_lv_get_name(const lv_t lv);
/**
* Get the attributes of a logical volume.
*
* \memberof lv_t
*
* The memory allocated for the name is tied to the vg_t handle and will be
* released when lvm_vg_close() is called.
*
* \param lv
* Logical volume handle.
*
* \return
* Copy of the attributes for the logical volume
*/
const char *lvm_lv_get_attr(const lv_t lv);
/**
* Get the current size in bytes of a logical volume.
*

View File

@ -57,6 +57,11 @@ const char *lvm_lv_get_name(const lv_t lv)
NAME_LEN+1);
}
const char *lvm_lv_get_attr(const lv_t lv)
{
return lv_attr_dup(lv->vg->vgmem, lv);
}
struct lvm_property_value lvm_lv_get_property(const lv_t lv, const char *name)
{
return get_property(NULL, NULL, lv, NULL, NULL, NULL, name);