1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

thin: lvm2api return origin property for thin LV

This commit is contained in:
Zdenek Kabelac 2012-10-12 12:02:15 +02:00
parent abb07a1b5e
commit be291e1064
3 changed files with 9 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.98 -
=================================
Fix lvm2api origin reporting for thin snapshot volume.
Add configure --enable-python_bindings for liblvm2app to new python subdir.
Add implementation of lvm2api function lvm_percent_to_float.
Allow non power of 2 thin chunk sizes if thin pool driver supports that.

View File

@ -160,6 +160,10 @@ char *lv_origin_dup(struct dm_pool *mem, const struct logical_volume *lv)
{
if (lv_is_cow(lv))
return lv_name_dup(mem, origin_from_cow(lv));
if (lv_is_thin_volume(lv) && first_seg(lv)->origin)
return lv_name_dup(mem, first_seg(lv)->origin);
return NULL;
}

View File

@ -57,6 +57,10 @@ int main(int argc, char *argv[])
assert(v.is_valid);
assert(v.value.integer == PERCENT_INVALID);
v = lvm_lv_get_property(lv, "origin");
assert(v.is_valid);
assert(strcmp(v.value.string, "thin") == 0);
lvm_vg_close(vg);
lvm_quit(handle);