# HG changeset patch # User root@linux # Node ID 2247c1872a29eda9ba00680a8e2d668e896daa1a # Parent 8e52de626fb52e7600c90744955ec135fba573e3 This patch fixes the issue where the Xen_HostedXXX association providers were not checking the returns from the CIMOMs for inppropriate returns. Signed-off-by: Raj Subrahmanian diff -r 8e52de626fb5 -r 2247c1872a29 src/Xen_HostedComputerSystem.c --- a/src/Xen_HostedComputerSystem.c Tue Jun 27 23:39:16 2006 +++ b/src/Xen_HostedComputerSystem.c Fri Jul 14 19:35:53 2006 @@ -54,7 +54,6 @@ static char * _RHSCLASSNAME = "CIM_ComputerSystem"; static char * _LHSPROPERTYNAME = "Dependent"; static char * _RHSPROPERTYNAME = "Antecedent"; - // ---------------------------------------------------------------------------- // AssociationCleanup() // Perform any necessary cleanup immediately before this provider is unloaded. @@ -247,8 +246,7 @@ CMPIData data = CMGetNext(instances, NULL); char *class = CMGetCharPtr(CMGetClassName(CMGetObjectPath(data.value.inst,NULL), NULL)); if (!(strcmp(class,targetclass) == 0) && ((resultClass == NULL) || (strcmp(class,resultClass) == 0))) { -// BUG - returning data causes crash !?! -_SBLIM_TRACE(2, ("--- data.value.inst=\"%s\"", CMGetCharPtr(CDToString(_BROKER, data.value.inst, NULL)))); + _SBLIM_TRACE(2, ("--- data.value.inst=\"%s\"", CMGetCharPtr(CDToString(_BROKER, data.value.inst, NULL)))); CMReturnInstance(results, data.value.inst); } } @@ -334,7 +332,7 @@ //char *class = CMGetCharPtr(CMGetClassName(data.value.ref, NULL)); // This used to be strcmp, now replaced with CMClassPathIsA //if (strcmp(class,targetclass) == 0) { - if(CMClassPathIsA(_BROKER, data.value.ref, targetclass, NULL)) { + if((CMClassPathIsA(_BROKER, data.value.ref, targetclass, NULL))&&(!CMClassPathIsA(_BROKER, data.value.ref, sourceclass, NULL))) { /* Create an object path for the association. */ CMPIObjectPath * refobjectpath = CMNewObjectPath(_BROKER, namespace, _ASSOCCLASS, &status); if ((status.rc != CMPI_RC_OK) || CMIsNullObject(refobjectpath)) { @@ -439,7 +437,7 @@ //char *class = CMGetCharPtr(CMGetClassName(data.value.ref, NULL)); // This used to be strcmp, now replaced with CMClassPathIsA //if (strcmp(class,targetclass) == 0) { - if(CMClassPathIsA(_BROKER, data.value.ref, targetclass, NULL)) { + if((CMClassPathIsA(_BROKER, data.value.ref, targetclass, NULL))&&(!CMClassPathIsA(_BROKER, data.value.ref, sourceclass, NULL))) { /* Create an instance for the association. */ CMPIInstance * refinstance = _CMNewInstance(_BROKER, namespace, _ASSOCCLASS, &status); if ((status.rc != CMPI_RC_OK) || CMIsNullObject(refinstance)) {