[lvm-devel] [PATCH 09/11] Add 'get' functions for a few vg string fields, vg_name and vg_fmt.

Dave Wysochanski dwysocha at redhat.com
Wed Aug 18 13:52:00 UTC 2010


Add _vg_name_get and _vg_fmt_get functions.

Signed-off-by: Dave Wysochanski <dwysocha at redhat.com>
---
 lib/report/properties.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/lib/report/properties.c b/lib/report/properties.c
index d21c2b0..027dafc 100644
--- a/lib/report/properties.c
+++ b/lib/report/properties.c
@@ -105,11 +105,26 @@ static int _not_implemented(void *obj, struct lvm_property_type *prop)
 #define _modules_set _not_implemented
 
 /* VG */
-#define _vg_fmt_get _not_implemented
+static int _vg_fmt_get (void *obj, struct lvm_property_type *prop)
+{
+	struct volume_group *vg = (struct volume_group *)obj;
+
+	if (!vg->fid || !vg->fid->fmt)
+		prop->v.s_val = NULL;
+	else
+		prop->v.s_val = (char *)vg->fid->fmt->name;
+	return 1;
+}
 #define _vg_fmt_set _not_implemented
 #define _vg_uuid_get _not_implemented
 #define _vg_uuid_set _not_implemented
-#define _vg_name_get _not_implemented
+static int _vg_name_get (void *obj, struct lvm_property_type *prop)
+{
+	struct volume_group *vg = (struct volume_group *)obj;
+
+	prop->v.s_val = (char *)vg->name;
+	return 1;
+}
 #define _vg_name_set _not_implemented
 #define _vg_attr_get _not_implemented
 #define _vg_attr_set _not_implemented
-- 
1.7.2.1




More information about the lvm-devel mailing list