[Libvirt-cim] [PATCH] Make ComputerSystem.RequestStateChange return a value, as required

Dan Smith danms at us.ibm.com
Wed Apr 23 16:00:37 UTC 2008


# HG changeset patch
# User Dan Smith <danms at us.ibm.com>
# Date 1208966419 25200
# Node ID cf121ecfb0824a34b42507fa36d06bf4cb45d0bc
# Parent  0721d65ee2fbd36ae46536706f3f6b2aff10392c
Make ComputerSystem.RequestStateChange return a value, as required.

Note: There should absolutely be a test case for this.

Signed-off-by: Dan Smith <danms at us.ibm.com>

diff -r 0721d65ee2fb -r cf121ecfb082 src/Virt_ComputerSystem.c
--- a/src/Virt_ComputerSystem.c	Wed Apr 23 06:57:25 2008 -0700
+++ b/src/Virt_ComputerSystem.c	Wed Apr 23 09:00:19 2008 -0700
@@ -825,6 +825,7 @@ static CMPIStatus state_change(CMPIMetho
         uint16_t state;
         int ret;
         const char *name = NULL;
+        uint32_t rc = 1;
 
         ret = cu_get_u16_arg(argsin, "RequestedState", &state);
         if (ret != CMPI_RC_OK) {
@@ -843,7 +844,12 @@ static CMPIStatus state_change(CMPIMetho
 
         s = __state_change(name, state, reference);
 
- out:
+        if (s.rc == CMPI_RC_OK)
+                rc = 0;
+
+ out:
+        CMReturnData(results, &rc, CMPI_uint32);
+
         return s;
 }
 




More information about the Libvirt-cim mailing list