Jay Gagnon wrote:
# HG changeset patch
# User Jay Gagnon <grendel(a)linux.vnet.ibm.com>
# Date 1194557266 18000
# Node ID fd6deb234772b44fe549a3513a47115a01e20f7d
# Parent bd1b1067d106ecc1546c3b2436a43f59f8eaba15
Turns out that the sdc_rasd_prop functions might need to report status or see the passed
in reference. This updates the typedef and the memory functions, since those are already
in the tree.
Signed-off-by: Jay Gagnon <grendel(a)linux.vnet.ibm.com>
diff -r bd1b1067d106 -r fd6deb234772 src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Thu Nov 08 10:43:48 2007 -0800
+++ b/src/Virt_SettingsDefineCapabilities.c Thu Nov 08 16:27:46 2007 -0500
@@ -96,84 +96,96 @@ static bool free_rasd_prop_list(struct s
return true;
}
-static struct sdc_rasd_prop *mem_max(void)
-{
- bool ret;
- struct sdc_rasd_prop *rasd;
+static struct sdc_rasd_prop *mem_max(const CMPIObjectPath *ref,
+ CMPIStatus *s)
+{
+ bool ret;
+ struct sdc_rasd_prop *rasd = NULL;
uint64_t max_vq = MAX_MEM;
- struct sdc_rasd_prop max[] = {
+ struct sdc_rasd_prop tmp[] = {
{"InstanceID", (CMPIValue *)"Maximum", CMPI_chars},
{"AllocationUnits", (CMPIValue *)"MegaBytes",
CMPI_chars},
{"VirtualQuantity", (CMPIValue *)&max_vq, CMPI_uint64},
PROP_END
};
- ret = dup_rasd_prop_list(max, &rasd);
- if (ret)
- return rasd;
- else
- return NULL;
-}
-
-static struct sdc_rasd_prop *mem_min(void)
-{
- bool ret;
- struct sdc_rasd_prop *rasd;
+ ret = dup_rasd_prop_list(tmp, &rasd);
+ if (!ret) {
+ cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED,
+ "Could not copy RASD.");
+ }
+
+ return rasd;
+}
Why is the ref param needed here? Is that something you'll be adding
later?
--
Kaitlin Rupert
IBM Linux Technology Center
karupert(a)us.ibm.com