summaryrefslogtreecommitdiff
path: root/liblvm/lvm_misc.c
diff options
context:
space:
mode:
authorPetr Rockai <prockai@redhat.com>2010-11-17 19:16:05 +0000
committerPetr Rockai <prockai@redhat.com>2010-11-17 19:16:05 +0000
commiteeaf3ba70a87d39855770482ee336d654e52a8cf (patch)
tree62a2bc6d89f4ee1a6c15bd98c38f25149d190abf /liblvm/lvm_misc.c
parentfd82d8c129e06d6f064dfd774ed64fae3133ff2e (diff)
downloadlvm2-eeaf3ba70a87d39855770482ee336d654e52a8cf.tar.gz
Implement lvm_vg_set_property() by calling internal 'set' property function.
Signed-off-by: Dave Wysochanski <wysochanski@pobox.com> Reviewed-by: Petr Rockai <prockai@redhat.com>
Diffstat (limited to 'liblvm/lvm_misc.c')
-rw-r--r--liblvm/lvm_misc.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/liblvm/lvm_misc.c b/liblvm/lvm_misc.c
index adec2bc57..30984e847 100644
--- a/liblvm/lvm_misc.c
+++ b/liblvm/lvm_misc.c
@@ -78,3 +78,33 @@ struct lvm_property_value get_property(const pv_t pv, const vg_t vg,
v.is_valid = 1;
return v;
}
+
+
+int set_property(const pv_t pv, const vg_t vg, const lv_t lv,
+ const char *name, struct lvm_property_value *v)
+{
+ struct lvm_property_type prop;
+
+ prop.id = name;
+ if (v->is_string)
+ prop.value.string = v->value.string;
+ else
+ prop.value.integer = v->value.integer;
+ if (pv) {
+ if (!pv_set_property(pv, &prop)) {
+ v->is_valid = 0;
+ return -1;
+ }
+ } else if (vg) {
+ if (!vg_set_property(vg, &prop)) {
+ v->is_valid = 0;
+ return -1;
+ }
+ } else if (lv) {
+ if (!lv_set_property(lv, &prop)) {
+ v->is_valid = 0;
+ return -1;
+ }
+ }
+ return 0;
+}