diff options
author | Tony Asleson <tasleson@redhat.com> | 2013-04-10 14:37:56 -0400 |
---|---|---|
committer | Tony Asleson <tasleson@redhat.com> | 2013-07-02 14:24:34 -0500 |
commit | 952605a8ea3a7c9eabeb89bb3d644b8b04b4239b (patch) | |
tree | d228cb929182cfdf3409aa617646c980b8bab74b /liblvm | |
parent | 588a16cadbb9000da8d5405ad69d3ed7024fd0fb (diff) | |
download | lvm2-952605a8ea3a7c9eabeb89bb3d644b8b04b4239b.tar.gz |
lvm2app: Add method to retrieve attr from lv.
Signed-off-by: Tony Asleson <tasleson@redhat.com>
Diffstat (limited to 'liblvm')
-rw-r--r-- | liblvm/lvm2app.h | 16 | ||||
-rw-r--r-- | liblvm/lvm_lv.c | 5 |
2 files changed, 21 insertions, 0 deletions
diff --git a/liblvm/lvm2app.h b/liblvm/lvm2app.h index 54a67c09f..4a0844ee8 100644 --- a/liblvm/lvm2app.h +++ b/liblvm/lvm2app.h @@ -1216,6 +1216,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. * * \memberof lv_t diff --git a/liblvm/lvm_lv.c b/liblvm/lvm_lv.c index d0f89f112..6226eacf2 100644 --- a/liblvm/lvm_lv.c +++ b/liblvm/lvm_lv.c @@ -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); |