2
* Copyright (C) 2012 Red Hat, Inc. All rights reserved.
4
* This file is part of LVM2.
6
* This copyrighted material is made available to anyone wishing to use,
7
* modify, copy, or redistribute it subject to the terms and conditions
8
* of the GNU Lesser General Public License v.2.1.
10
* You should have received a copy of the GNU Lesser General Public License
11
* along with this program; if not, write to the Free Software Foundation,
12
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
int main(int argc, char *argv[])
25
struct lvm_property_value v;
27
handle = lvm_init(NULL);
30
vg = lvm_vg_open(handle, argv[1], "r", 0);
33
lv = lvm_lv_from_name(vg, "pool");
36
v = lvm_lv_get_property(lv, "data_percent");
38
assert(v.value.integer == 25 * PERCENT_1);
41
lv = lvm_lv_from_name(vg, "thin");
44
v = lvm_lv_get_property(lv, "data_percent");
46
assert(v.value.integer == 50 * PERCENT_1);
49
lv = lvm_lv_from_name(vg, "snap");
52
v = lvm_lv_get_property(lv, "data_percent");
54
assert(v.value.integer == 75 * PERCENT_1);
56
v = lvm_lv_get_property(lv, "snap_percent");
58
assert(v.value.integer == PERCENT_INVALID);
60
v = lvm_lv_get_property(lv, "origin");
62
assert(strcmp(v.value.string, "thin") == 0);