
+static CMPIStatus set_properties_from_dominfo(const CMPIBroker *broker, + const char *prefix, + struct domain *dominfo, + CMPIInstance *instance) +{ + CMPIStatus s = {CMPI_RC_ERR_FAILED, NULL};
Since you set the status when an error occurs, just set this to CMPI_RC_OK.
+ CMPIObjectPath *ref = NULL; + + ref = CMGetObjectPath(instance, &s); + if ((ref == NULL) || (s.rc != CMPI_RC_OK)) + return s; + + CMSetProperty(instance, "Name", + (CMPIValue *)dominfo->name, CMPI_chars); + + CMSetProperty(instance, "ElementName", + (CMPIValue *)dominfo->name, CMPI_chars); + + CMSetProperty(instance, "UUID", + (CMPIValue *)dominfo->uuid, CMPI_chars); + + if (!set_capdesc_from_dominfo(broker, dominfo, ref, instance)) { + CU_DEBUG("Problem in set_capdesc_from_dominfo function"); + cu_statusf(broker, &s, + CMPI_RC_FAILED,
This should be CMPI_RC_ERR_FAILED.
+ "Could not set caption and description properties"); + goto out; + } + + /* We don't set state, because struct domain doesn't have that + * information */ + + if (!set_creation_class(instance)) { + CU_DEBUG("Problem in set_creation_class function"); + cu_statusf(broker, &s, + CMPI_RC_FAILED,
Here's as well.
+ "Could not set creation class"); + goto out; + } + + if (!set_other_id_info(broker, dominfo->uuid, prefix, instance)) { + CU_DEBUG("Problem in set_other_id_info function"); + cu_statusf(broker, &s, + CMPI_RC_FAILED,
Here too.
+ "Could not set other OtherIdentifyingInfo and " + "IdentifyingDescription"); + goto out; + } + + cu_statusf(broker, &s, + CMPI_RC_OK, + "");
This is not needed if you initialize s to be CMPI_RC_OK.
+ + out: + return s; +}
-- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com