From: Tyrel D. <ty...@us...> - 2013-02-26 02:18:37
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "gather - Metric Data Gatherer". The branch, master has been updated via b42647e0448cacb06fe4a0ec441cc8fe05e8be8e (commit) from ba11c046eb07a53a71d5a998e805b9d1b29c83a7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b42647e0448cacb06fe4a0ec441cc8fe05e8be8e Author: Tyrel Datwyler <ty...@li...> Date: Mon Feb 25 18:17:44 2013 -0800 Fixed #2045: Metric assoc providers don't honor result class ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + .../OSBase_MetricElementCapabilitiesProvider.c | 28 +++++++++++-------- ...OSBase_MetricElementConformsToProfileProvider.c | 28 +++++++++++-------- provider/OSBase_MetricHostedServiceProvider.c | 28 +++++++++++-------- .../OSBase_MetricServiceAffectsElementProvider.c | 28 +++++++++++-------- 5 files changed, 65 insertions(+), 48 deletions(-) diff --git a/NEWS b/NEWS index 4768bc0..4aef35f 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ Bugs fixed: - 3603719 Clean up configuration toolchain and fix DSO linking - 3196679 remove sysfs dependency when not building z plugins - #2023 clean up compile warnings +- #2045 Metric assoc providers don't honor result class Features added: - 2284848 CPU utilization should account for steal-time diff --git a/provider/OSBase_MetricElementCapabilitiesProvider.c b/provider/OSBase_MetricElementCapabilitiesProvider.c index e4fda1f..370ea3f 100644 --- a/provider/OSBase_MetricElementCapabilitiesProvider.c +++ b/provider/OSBase_MetricElementCapabilitiesProvider.c @@ -175,7 +175,7 @@ static CMPIStatus Associators(CMPIAssociationMI * mi, const char * resultRole, const char ** properties) { - CMPIEnumeration * assoc; + CMPIEnumeration * assoc = NULL; CMPIObjectPath * cop; CMPIInstance * inst; CMPIData data; @@ -191,20 +191,22 @@ static CMPIStatus Associators(CMPIAssociationMI * mi, CMGetCharPtr(CMGetNameSpace(op, NULL)), _RIGHTREF, NULL); - - assoc = CBEnumInstances(_broker, ctx, cop, properties, &rc); + if (CMClassPathIsA(_broker, cop, resultClass, &rc)) { + assoc = CBEnumInstances(_broker, ctx, cop, properties, &rc); + } } else if (CMClassPathIsA(_broker, op, _RIGHTREF, NULL)) { cop = CMNewObjectPath(_broker, CMGetCharPtr(CMGetNameSpace(op, NULL)), _LEFTREF, NULL); - - assoc = CBEnumInstances(_broker, ctx, cop, properties, &rc); + if (CMClassPathIsA(_broker, cop, resultClass, &rc)) { + assoc = CBEnumInstances(_broker, ctx, cop, properties, &rc); + } } else { return rc; } - if (CMHasNext(assoc, &rc)) { + if (assoc && CMHasNext(assoc, &rc)) { data = CMGetNext(assoc, NULL); CMReturnInstance(rslt, data.value.inst); } else { @@ -224,7 +226,7 @@ static CMPIStatus AssociatorNames(CMPIAssociationMI * mi, const char * role, const char * resultRole) { - CMPIEnumeration * assoc; + CMPIEnumeration * assoc = NULL; CMPIObjectPath * cop; CMPIInstance * inst; CMPIData data; @@ -240,20 +242,22 @@ static CMPIStatus AssociatorNames(CMPIAssociationMI * mi, CMGetCharPtr(CMGetNameSpace(op, NULL)), _RIGHTREF, NULL); - - assoc = CBEnumInstanceNames(_broker, ctx, cop, &rc); + if (CMClassPathIsA(_broker, cop, resultClass, &rc)) { + assoc = CBEnumInstanceNames(_broker, ctx, cop, &rc); + } } else if (CMClassPathIsA(_broker, op, _RIGHTREF, NULL)) { cop = CMNewObjectPath(_broker, CMGetCharPtr(CMGetNameSpace(op, NULL)), _LEFTREF, NULL); - - assoc = CBEnumInstanceNames(_broker, ctx, cop, &rc); + if (CMClassPathIsA(_broker, cop, resultClass, &rc)) { + assoc = CBEnumInstanceNames(_broker, ctx, cop, &rc); + } } else { return rc; } - if (CMHasNext(assoc, &rc)) { + if (assoc && CMHasNext(assoc, &rc)) { data = CMGetNext(assoc, NULL); CMReturnObjectPath(rslt, data.value.ref); } else { diff --git a/provider/OSBase_MetricElementConformsToProfileProvider.c b/provider/OSBase_MetricElementConformsToProfileProvider.c index cda8167..220d810 100644 --- a/provider/OSBase_MetricElementConformsToProfileProvider.c +++ b/provider/OSBase_MetricElementConformsToProfileProvider.c @@ -178,7 +178,7 @@ static CMPIStatus Associators(CMPIAssociationMI * mi, const char * resultRole, const char ** properties) { - CMPIEnumeration * assoc; + CMPIEnumeration * assoc = NULL; CMPIObjectPath * cop; CMPIInstance * inst; CMPIData data; @@ -194,20 +194,22 @@ static CMPIStatus Associators(CMPIAssociationMI * mi, _CIMV2, _RIGHTREF, NULL); - - assoc = CBEnumInstances(_broker, ctx, cop, properties, &rc); + if (CMClassPathIsA(_broker, cop, resultClass, &rc)) { + assoc = CBEnumInstances(_broker, ctx, cop, properties, &rc); + } } else if (CMClassPathIsA(_broker, op, _RIGHTREF, NULL)) { cop = CMNewObjectPath(_broker, _INTEROP, _LEFTREF, NULL); - - assoc = CBEnumInstances(_broker, ctx, cop, properties, &rc); + if (CMClassPathIsA(_broker, cop, resultClass, &rc)) { + assoc = CBEnumInstances(_broker, ctx, cop, properties, &rc); + } } else { return rc; } - if (CMHasNext(assoc, &rc)) { + if (assoc && CMHasNext(assoc, &rc)) { data = CMGetNext(assoc, NULL); CMReturnInstance(rslt, data.value.inst); } else { @@ -227,7 +229,7 @@ static CMPIStatus AssociatorNames(CMPIAssociationMI * mi, const char * role, const char * resultRole) { - CMPIEnumeration * assoc; + CMPIEnumeration * assoc = NULL; CMPIObjectPath * cop; CMPIInstance * inst; CMPIData data; @@ -243,20 +245,22 @@ static CMPIStatus AssociatorNames(CMPIAssociationMI * mi, _CIMV2, _RIGHTREF, NULL); - - assoc = CBEnumInstanceNames(_broker, ctx, cop, &rc); + if (CMClassPathIsA(_broker, cop, resultClass, &rc)) { + assoc = CBEnumInstanceNames(_broker, ctx, cop, &rc); + } } else if (CMClassPathIsA(_broker, op, _RIGHTREF, NULL)) { cop = CMNewObjectPath(_broker, _INTEROP, _LEFTREF, NULL); - - assoc = CBEnumInstanceNames(_broker, ctx, cop, &rc); + if (CMClassPathIsA(_broker, cop, resultClass, &rc)) { + assoc = CBEnumInstanceNames(_broker, ctx, cop, &rc); + } } else { return rc; } - if (CMHasNext(assoc, &rc)) { + if (assoc && CMHasNext(assoc, &rc)) { data = CMGetNext(assoc, NULL); CMReturnObjectPath(rslt, data.value.ref); } else { diff --git a/provider/OSBase_MetricHostedServiceProvider.c b/provider/OSBase_MetricHostedServiceProvider.c index fef7aa6..9b70727 100644 --- a/provider/OSBase_MetricHostedServiceProvider.c +++ b/provider/OSBase_MetricHostedServiceProvider.c @@ -175,7 +175,7 @@ static CMPIStatus Associators(CMPIAssociationMI * mi, const char * resultRole, const char ** properties) { - CMPIEnumeration * assoc; + CMPIEnumeration * assoc = NULL; CMPIObjectPath * cop; CMPIInstance * inst; CMPIData data; @@ -191,20 +191,22 @@ static CMPIStatus Associators(CMPIAssociationMI * mi, CMGetCharPtr(CMGetNameSpace(op, NULL)), _RIGHTREF, NULL); - - assoc = CBEnumInstances(_broker, ctx, cop, properties, &rc); + if (resultClass && CMClassPathIsA(_broker, cop, resultClass, &rc)) { + assoc = CBEnumInstances(_broker, ctx, cop, properties, &rc); + } } else if (CMClassPathIsA(_broker, op, _RIGHTREF, NULL)) { cop = CMNewObjectPath(_broker, CMGetCharPtr(CMGetNameSpace(op, NULL)), _LEFTREF, NULL); - - assoc = CBEnumInstances(_broker, ctx, cop, properties, &rc); + if (resultClass && CMClassPathIsA(_broker, cop, resultClass, &rc)) { + assoc = CBEnumInstances(_broker, ctx, cop, properties, &rc); + } } else { return rc; } - if (CMHasNext(assoc, &rc)) { + if (assoc && CMHasNext(assoc, &rc)) { data = CMGetNext(assoc, NULL); CMReturnInstance(rslt, data.value.inst); } else { @@ -224,7 +226,7 @@ static CMPIStatus AssociatorNames(CMPIAssociationMI * mi, const char * role, const char * resultRole) { - CMPIEnumeration * assoc; + CMPIEnumeration * assoc = NULL; CMPIObjectPath * cop; CMPIInstance * inst; CMPIData data; @@ -240,20 +242,22 @@ static CMPIStatus AssociatorNames(CMPIAssociationMI * mi, CMGetCharPtr(CMGetNameSpace(op, NULL)), _RIGHTREF, NULL); - - assoc = CBEnumInstanceNames(_broker, ctx, cop, &rc); + if (CMClassPathIsA(_broker, cop, resultClass, &rc)) { + assoc = CBEnumInstanceNames(_broker, ctx, cop, &rc); + } } else if (CMClassPathIsA(_broker, op, _RIGHTREF, NULL)) { cop = CMNewObjectPath(_broker, CMGetCharPtr(CMGetNameSpace(op, NULL)), _LEFTREF, NULL); - - assoc = CBEnumInstanceNames(_broker, ctx, cop, &rc); + if (CMClassPathIsA(_broker, cop, resultClass, &rc)) { + assoc = CBEnumInstanceNames(_broker, ctx, cop, &rc); + } } else { return rc; } - if (CMHasNext(assoc, &rc)) { + if (assoc && CMHasNext(assoc, &rc)) { data = CMGetNext(assoc, NULL); CMReturnObjectPath(rslt, data.value.ref); } else { diff --git a/provider/OSBase_MetricServiceAffectsElementProvider.c b/provider/OSBase_MetricServiceAffectsElementProvider.c index f28309a..4b3c4ff 100644 --- a/provider/OSBase_MetricServiceAffectsElementProvider.c +++ b/provider/OSBase_MetricServiceAffectsElementProvider.c @@ -175,7 +175,7 @@ static CMPIStatus Associators(CMPIAssociationMI * mi, const char * resultRole, const char ** properties) { - CMPIEnumeration * assoc; + CMPIEnumeration * assoc = NULL; CMPIObjectPath * cop; CMPIInstance * inst; CMPIData data; @@ -191,20 +191,22 @@ static CMPIStatus Associators(CMPIAssociationMI * mi, CMGetCharPtr(CMGetNameSpace(op, NULL)), _RIGHTREF, NULL); - - assoc = CBEnumInstances(_broker, ctx, cop, properties, &rc); + if (CMClassPathIsA(_broker, cop, resultClass, &rc)) { + assoc = CBEnumInstances(_broker, ctx, cop, properties, &rc); + } } else if (CMClassPathIsA(_broker, op, _RIGHTREF, NULL)) { cop = CMNewObjectPath(_broker, CMGetCharPtr(CMGetNameSpace(op, NULL)), _LEFTREF, NULL); - - assoc = CBEnumInstances(_broker, ctx, cop, properties, &rc); + if (CMClassPathIsA(_broker, cop, resultClass, &rc)) { + assoc = CBEnumInstances(_broker, ctx, cop, properties, &rc); + } } else { return rc; } - if (CMHasNext(assoc, &rc)) { + if (assoc && CMHasNext(assoc, &rc)) { while(CMHasNext(assoc, &rc)) { data = CMGetNext(assoc, NULL); CMReturnInstance(rslt, data.value.inst); @@ -226,7 +228,7 @@ static CMPIStatus AssociatorNames(CMPIAssociationMI * mi, const char * role, const char * resultRole) { - CMPIEnumeration * assoc; + CMPIEnumeration * assoc = NULL; CMPIObjectPath * cop; CMPIInstance * inst; CMPIData data; @@ -242,20 +244,22 @@ static CMPIStatus AssociatorNames(CMPIAssociationMI * mi, CMGetCharPtr(CMGetNameSpace(op, NULL)), _RIGHTREF, NULL); - - assoc = CBEnumInstanceNames(_broker, ctx, cop, &rc); + if (CMClassPathIsA(_broker, cop, resultClass, &rc)) { + assoc = CBEnumInstanceNames(_broker, ctx, cop, &rc); + } } else if (CMClassPathIsA(_broker, op, _RIGHTREF, NULL)) { cop = CMNewObjectPath(_broker, CMGetCharPtr(CMGetNameSpace(op, NULL)), _LEFTREF, NULL); - - assoc = CBEnumInstanceNames(_broker, ctx, cop, &rc); + if (CMClassPathIsA(_broker, cop, resultClass, &rc)) { + assoc = CBEnumInstanceNames(_broker, ctx, cop, &rc); + } } else { return rc; } - if (CMHasNext(assoc, &rc)) { + if (assoc && CMHasNext(assoc, &rc)) { while (CMHasNext(assoc, &rc)) { data = CMGetNext(assoc, NULL); CMReturnObjectPath(rslt, data.value.ref); hooks/post-receive -- gather - Metric Data Gatherer |