[PATCH 1/5] Add 'is_integer' flag into internal lvm_property_type.

Dave Wysochanski <[email protected]>
Newsgroups dev.linux.lists.lvm-devel
Message-ID <[email protected]>
Add 'is_integer' flag similar to 'is_string'.
Suggested in review by Petr Rockai.

Signed-off-by: Dave Wysochanski <[email protected]>
---
 lib/report/properties.c |    4 ++--
 lib/report/properties.h |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/report/properties.c b/lib/report/properties.c
index c08ddfd..339fd84 100644
--- a/lib/report/properties.c
+++ b/lib/report/properties.c
@@ -227,11 +227,11 @@ GET_VG_NUM_PROPERTY_FN(vg_mda_copies, (vg_mda_copies(vg)))
 #define STR DM_REPORT_FIELD_TYPE_STRING
 #define NUM DM_REPORT_FIELD_TYPE_NUMBER
 #define FIELD(type, strct, sorttype, head, field, width, fn, id, desc, settable) \
-	{ type, #id, settable, sorttype == STR, { .integer = 0 }, _ ## id ## _get, _ ## id ## _set },
+	{ type, #id, settable, sorttype == STR, sorttype == NUM, { .integer = 0 }, _ ## id ## _get, _ ## id ## _set },
 
 struct lvm_property_type _properties[] = {
 #include "columns.h"
-	{ 0, "", 0, 0, { .integer = 0 }, _not_implemented_get, _not_implemented_set },
+	{ 0, "", 0, 0, 0, { .integer = 0 }, _not_implemented_get, _not_implemented_set },
 };
 
 #undef STR
diff --git a/lib/report/properties.h b/lib/report/properties.h
index 18e5ab9..054f400 100644
--- a/lib/report/properties.h
+++ b/lib/report/properties.h
@@ -24,6 +24,7 @@ struct lvm_property_type {
 	const char *id;
 	unsigned is_settable:1;
 	unsigned is_string:1;
+	unsigned is_integer:1;
 	union {
 		char *string;
 		uint64_t integer;
-- 
1.7.2.2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.