# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1223052487 25200
# Node ID cc78b9491823c2cb3db064039c48cb980ab28ee7
# Parent 2952b0fb0fef8e77b34c04a779ac44b1d092876f
Have DefineSystem() return error if VirtualQuantity of proc/mem RASD isn't set
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 2952b0fb0fef -r cc78b9491823 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Fri Oct 03 09:46:29 2008 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Fri Oct 03 09:48:07 2008 -0700
@@ -450,10 +450,16 @@
struct virt_device *dev)
{
const char *units;
+ CMPIrc ret;
int shift;
- cu_get_u64_prop(inst, "VirtualQuantity", &dev->dev.mem.size);
- cu_get_u64_prop(inst, "Reservation", &dev->dev.mem.size);
+ ret = cu_get_u64_prop(inst, "VirtualQuantity",
&dev->dev.mem.size);
+ if (ret != CMPI_RC_OK)
+ ret = cu_get_u64_prop(inst, "Reservation",
&dev->dev.mem.size);
+
+ if (ret != CMPI_RC_OK)
+ return "Missing `VirtualQuantity' field in Memory RASD";
+
dev->dev.mem.maxsize = dev->dev.mem.size;
cu_get_u64_prop(inst, "Limit", &dev->dev.mem.maxsize);
@@ -492,7 +498,9 @@
uint32_t def_weight = 0;
uint64_t def_limit = 0;
- cu_get_u64_prop(inst, "VirtualQuantity",
&dev->dev.vcpu.quantity);
+ rc = cu_get_u64_prop(inst, "VirtualQuantity",
&dev->dev.vcpu.quantity);
+ if (rc != CMPI_RC_OK)
+ return "Missing `VirtualQuantity' field in Processor
RASD";
op = CMGetObjectPath(inst, NULL);
if (op == NULL) {
Show replies by date