summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Minar <miminar@redhat.com>2013-10-09 15:06:49 +0200
committerMichal Minar <miminar@redhat.com>2013-10-10 14:16:20 +0200
commit1eaedfe0c5e16074666dff1f9864087a3b8bbff8 (patch)
treee5dedbc0ccead021a3975b86c15e5863b47d9c35
parentc301f616b578da6e3ffedcfa5cf04a1d8c162c64 (diff)
downloadopenlmi-providers-1eaedfe0c5e16074666dff1f9864087a3b8bbff8.tar.gz
openlmi-providers-1eaedfe0c5e16074666dff1f9864087a3b8bbff8.tar.xz
openlmi-providers-1eaedfe0c5e16074666dff1f9864087a3b8bbff8.zip
hardware: allow compilation for older cim-schema
Compilation fails with older schema (preceding 2.38.0) because of missing Values in CIM_Processor::Family's qualifiers. Let's check whether the values get generated by konkret and fallback to custom defines.
-rw-r--r--src/hardware/LMI_ProcessorProvider.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/hardware/LMI_ProcessorProvider.c b/src/hardware/LMI_ProcessorProvider.c
index 8a037ea..903e112 100644
--- a/src/hardware/LMI_ProcessorProvider.c
+++ b/src/hardware/LMI_ProcessorProvider.c
@@ -29,6 +29,16 @@
#include "lscpu.h"
#include "procfs.h"
+/**
+ * CIM schema defines Values for CIM_Processor::Family property since version
+ * 2.38.0. With older versions the LMI_Processor_Family_Enum won't be generated
+ * by konkret (in LMI_Processor.h).
+*/
+#ifndef LMI_Processor_Family_Enum
+ // CIM schema is older than 2.38.0
+ #define LMI_Processor_Family_Other 1
+#endif
+
CMPIUint16 get_family(const char *family);
CMPIUint16 get_cpustatus(const char *status);
CMPIUint16 get_enabledstate(const CMPIUint16 status);