Please find below a patch to Virt_SettingsDefineCapabilities.c to fix a
couple issues I found:
- The CIM_AllocationCapabilities for 'Default' RASDs have the incorrect
ValueRole. per DSP1043 "Allocation Capabilities Profile", Section 10.5
"CIM_SettingsDefineCapabilities – Default" the ValueRole should be 0
("Default")
- Fixed mistake with usage of strstr() swapping the arguments; should be:
char *strstr(const char *haystack, const char *needle);
This may not have mattered before when both strings were always exactly
same or didnt match, but now for new 'Point' instances the instanceid has
a prefix. [Thnx Sharad for catching this]
Please excuse the fact the patch is not in the correct format - I am still
setting up my mercurial to correctly format and post patches, thnx.
# User Dr. Gareth S. Bestor <bestor(a)us.ibm.com>
#
diff -r 395f2d684c10 src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Tue Jul 05 15:52:31 2011
-0300
+++ b/src/Virt_SettingsDefineCapabilities.c Mon Jul 18 04:11:35 2011
-0700
@@ -2054,20 +2188,21 @@
goto out;
}
- if (strstr("Default", iid) != NULL)
+ if (strstr(iid, "Default") != NULL) {
valuerange = SDC_RANGE_POINT;
- else if (strstr("Increment", iid) != NULL)
+ valuerole = SDC_ROLE_DEFAULT;
+ }
+ else if (strstr(iid, "Point") != NULL)
+ valuerange = SDC_RANGE_POINT;
+ else if (strstr(iid, "Increment") != NULL)
valuerange = SDC_RANGE_INC;
- else if (strstr("Maximum", iid) != NULL)
+ else if (strstr(iid, "Maximum") != NULL)
valuerange = SDC_RANGE_MAX;
- else if (strstr("Minimum", iid) != NULL)
+ else if (strstr(iid, "Minimum") != NULL)
valuerange = SDC_RANGE_MIN;
else
CU_DEBUG("Unknown default RASD type: `%s'", iid);
- if (valuerange == SDC_RANGE_POINT)
- valuerole = SDC_ROLE_DEFAULT;
-
CMSetProperty(ref_inst, "ValueRole",
(CMPIValue *)&valuerole, CMPI_uint16);
CMSetProperty(ref_inst, "ValueRange",
Dr. Gareth S. Bestor
IBM Senior Software Engineer
Systems & Technology Group - Systems Management Standards
971-285-6375 (mobile)
bestor(a)us.ibm.com
Show replies by date