[Libvirt-cim] [PATCH] Make migration return proper value for "Job Started"

Dan Smith danms at us.ibm.com
Wed Mar 12 20:22:18 UTC 2008


# HG changeset patch
# User Dan Smith <danms at us.ibm.com>
# Date 1205353332 25200
# Node ID 4aa425bba4e2f0834001bef08766e06a83c50da2
# Parent  42b808d88849cbc642af67b2769b120624f66a42
Make migration return proper value for "Job Started"

Changes:
 - Use a constant for return value.  This seems to be a convention at least
   in the SVPC profiles, although it's relatively informally defined.

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

diff -r 42b808d88849 -r 4aa425bba4e2 src/Virt_VSMigrationService.c
--- a/src/Virt_VSMigrationService.c	Wed Mar 12 09:47:04 2008 -0700
+++ b/src/Virt_VSMigrationService.c	Wed Mar 12 13:22:12 2008 -0700
@@ -40,6 +40,7 @@
 #include "Virt_HostSystem.h"
 #include "Virt_ComputerSystem.h"
 #include "Virt_VSMigrationSettingData.h"
+#include "svpc_types.h"
 
 #define CIM_JOBSTATE_STARTING 3
 #define CIM_JOBSTATE_RUNNING 4
@@ -307,7 +308,7 @@ static CMPIStatus vs_migratable(const CM
         if (s.rc != CMPI_RC_OK)
                 goto out;
 
-        retcode = 0;
+        retcode = CIM_SVPC_RETURN_COMPLETED;
         cu_statusf(_BROKER, &s,
                    CMPI_RC_OK,
                    "");
@@ -933,7 +934,7 @@ static CMPIStatus migrate_do(const CMPIO
 
         thread = _BROKER->xft->newThread((void*)migration_thread, job, 0);
 
-        retcode = 0;
+        retcode = CIM_SVPC_RETURN_JOB_STARTED;
 
  out:
         CMReturnData(results, (CMPIValue *)&retcode, CMPI_uint32);
diff -r 42b808d88849 -r 4aa425bba4e2 src/svpc_types.h
--- a/src/svpc_types.h	Wed Mar 12 09:47:04 2008 -0700
+++ b/src/svpc_types.h	Wed Mar 12 13:22:12 2008 -0700
@@ -44,6 +44,9 @@ const static int cim_res_types[CIM_RES_T
 /* Vendor-specific extension; should be documented somewhere */
 #define CIM_VSSD_RECOVERY_PRESERVE 123
 
+#define CIM_SVPC_RETURN_JOB_STARTED   4096
+#define CIM_SVPC_RETURN_COMPLETED        0
+
 #include <libcmpiutil/libcmpiutil.h>
 #include <string.h>
 




More information about the Libvirt-cim mailing list