[PATCH] Make migration return proper value for "Job Started"
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1205331569 25200
# Node ID 82b18a386bda9c09e6f4f41a0b3acbeeba7f0ea9
# Parent b739fc9b13320e07a39f3932396c8411c2d4ad75
Make migration return proper value for "Job Started"
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r b739fc9b1332 -r 82b18a386bda src/Virt_VSMigrationService.c
--- a/src/Virt_VSMigrationService.c Tue Mar 11 13:28:04 2008 -0700
+++ b/src/Virt_VSMigrationService.c Wed Mar 12 07:19:29 2008 -0700
@@ -927,7 +927,7 @@ static CMPIStatus migrate_do(const CMPIO
thread = _BROKER->xft->newThread((void*)migration_thread, job, 0);
- retcode = 0;
+ retcode = 4096; /* Job Started */
out:
CMReturnData(results, (CMPIValue *)&retcode, CMPI_uint32);
16 years, 9 months
[PATCH] Fix indication_tester's filter deletion issue
by Jay Gagnon
# HG changeset patch
# User Jay Gagnon <grendel(a)linux.vnet.ibm.com>
# Date 1205167743 14400
# Node ID 4b34c7474e59f939200cdfeaa7d3414cfc6f7c13
# Parent d93bb8c00423a88f1c9475a8e6076b1945e1dd01
Fix indication_tester's filter deletion issue
A while ago we discovered that giving the same name to various tests in indication_tester doesn't work, even when the first test's filter, handler, and subscription should have been deleted once it was done running. It turns out that indication_tester wasn't deleting the filter, due to some bad xml. This fixes the xml and eliminates the need to use the -n switch unless you want multiple simultaneous tests.
Signed-off-by: Jay Gagnon <grendel(a)linux.vnet.ibm.com>
diff -r d93bb8c00423 -r 4b34c7474e59 tools/indication_tester.py
--- a/tools/indication_tester.py Mon Mar 03 06:48:26 2008 -0800
+++ b/tools/indication_tester.py Mon Mar 10 12:49:03 2008 -0400
@@ -181,7 +181,7 @@ def delete_inst_xml(name, type, sysname)
<NAMESPACE NAME="PG_InterOp"/>
</LOCALNAMESPACEPATH>
<IPARAMVALUE NAME="InstanceName">
- <INSTANCENAME CLASSNAME="CIM_Indication%sCIMXML">
+ <INSTANCENAME CLASSNAME="CIM_Indication%s">
<KEYBINDING NAME="SystemCreationClassName">
<KEYVALUE>CIM_ComputerSystem</KEYVALUE>
</KEYBINDING>
@@ -189,7 +189,7 @@ def delete_inst_xml(name, type, sysname)
<KEYVALUE>%s</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="CreationClassName">
- <KEYVALUE>CIM_Indication%sCIMXML</KEYVALUE>
+ <KEYVALUE>CIM_Indication%s</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="Name">
<KEYVALUE>%s%s</KEYVALUE>
16 years, 9 months
Migration check patches
by Stefan Berger
Hello Dan,
thanks for providing the external migration check patches. They were
very helpful and work well.
Thanks
Stefan
16 years, 9 months
[PATCH] Fix cu_statusf() call in RASD
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1205258941 25200
# Node ID 4f17d756b6c3551d1ae0a3aee1939a5ad6963c67
# Parent 1429af47e9413d5f0bcf51e5a58988177bc32bbf
Fix cu_statusf() call in RASD.
It's not easy to tell from the diff, but get_rasd_by_ref() takes a const CMPIBroker *broker argument. So when we fail, we need to use the broker, not the _BROKER that is local to the provider.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 1429af47e941 -r 4f17d756b6c3 src/Virt_RASD.c
--- a/src/Virt_RASD.c Tue Mar 11 10:18:05 2008 -0700
+++ b/src/Virt_RASD.c Tue Mar 11 11:09:01 2008 -0700
@@ -433,7 +433,7 @@ CMPIStatus get_rasd_by_ref(const CMPIBro
uint16_t type;
if (cu_get_str_path(reference, "InstanceID", &name) != CMPI_RC_OK) {
- cu_statusf(_BROKER, &s,
+ cu_statusf(broker, &s,
CMPI_RC_ERR_FAILED,
"Missing InstanceID");
goto out;
16 years, 9 months
[PATCH] [CU] Add cu_get_array_prop()
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1205173351 25200
# Node ID e7d4d1f30118bbc0e484fd4f4fd80747b63435d5
# Parent d93bb8c00423a88f1c9475a8e6076b1945e1dd01
[CU] Add cu_get_array_prop()
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r d93bb8c00423 -r e7d4d1f30118 args_util.c
--- a/args_util.c Mon Mar 03 06:48:26 2008 -0800
+++ b/args_util.c Mon Mar 10 11:22:31 2008 -0700
@@ -192,6 +192,27 @@ CMPIrc cu_get_u16_arg(const CMPIArgs *ar
pv = CMGetProperty(i, p, s); \
if ((s)->rc != CMPI_RC_OK || CMIsNullValue(pv)) \
return CMPI_RC_ERR_NO_SUCH_PROPERTY;
+
+CMPIrc cu_get_array_prop(const CMPIInstance *inst,
+ const char *prop,
+ CMPIArray **array)
+{
+ CMPIData value;
+ CMPIStatus s;
+
+ REQUIRE_PROPERTY_DEFINED(inst, prop, value, &s);
+
+ value = CMGetProperty(inst, prop, &s);
+ if ((s.rc != CMPI_RC_OK) || CMIsNullValue(value))
+ return s.rc;
+
+ if (!CMIsArray(value) || CMIsNullObject(value.value.array))
+ return CMPI_RC_ERR_TYPE_MISMATCH;
+
+ *array = value.value.array;
+
+ return CMPI_RC_OK;
+}
CMPIrc cu_get_str_prop(const CMPIInstance *inst,
const char *prop,
diff -r d93bb8c00423 -r e7d4d1f30118 libcmpiutil.h
--- a/libcmpiutil.h Mon Mar 03 06:48:26 2008 -0800
+++ b/libcmpiutil.h Mon Mar 10 11:22:31 2008 -0700
@@ -211,6 +211,23 @@ bool cu_return_instance_name(const CMPIR
*/
unsigned int cu_return_instance_names(const CMPIResult *results,
const struct inst_list *list);
+
+/**
+ * Get an array property of an instance
+ *
+ * @param inst The instance
+ * @param prop The property name
+ * @param target A pointer to a CMPIarray that will be set
+ * if successful
+ * @returns
+ * - CMPI_RC_OK on success,
+ * - CMPI_RC_ERR_NO_SUCH_PROPERTY if prop is not present,
+ * - CMPI_RC_ERR_TYPE_MISMATCH if prop is not an array,
+ * - CMPI_RC_ERROR otherwise
+ */
+CMPIrc cu_get_array_prop(const CMPIInstance *inst,
+ const char *prop,
+ CMPIArray **array);
/**
* Get a string property of an instance
16 years, 9 months
[PATCH] Add iteration functionality for CIM_RES_TYPE_ALL
by Heidi Eckhart
# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1205156447 -3600
# Node ID 1325969aff7f736a9b17b4cd259f9608890d11bf
# Parent f82efd4364f1f27c1ec7ceaedafc281379007b38
Add iteration functionality for CIM_RES_TYPE_ALL
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r f82efd4364f1 -r 1325969aff7f src/Virt_Device.c
--- a/src/Virt_Device.c Fri Mar 07 15:24:38 2008 -0800
+++ b/src/Virt_Device.c Mon Mar 10 14:40:47 2008 +0100
@@ -322,28 +322,15 @@ static CMPIStatus _enum_devices(const CM
struct inst_list *list)
{
CMPIStatus s;
+ int i;
if (type == CIM_RES_TYPE_ALL) {
- s = _get_devices(broker,
- reference,
- dom,
- CIM_RES_TYPE_PROC,
- list);
- s = _get_devices(broker,
- reference,
- dom,
- CIM_RES_TYPE_NET,
- list);
- s = _get_devices(broker,
- reference,
- dom,
- CIM_RES_TYPE_MEM,
- list);
- s = _get_devices(broker,
- reference,
- dom,
- CIM_RES_TYPE_DISK,
- list);
+ for (i=0; i<CIM_RES_TYPE_COUNT; i++)
+ s = _get_devices(broker,
+ reference,
+ dom,
+ cim_res_types[i],
+ list);
}
else
s = _get_devices(broker,
diff -r f82efd4364f1 -r 1325969aff7f src/Virt_RASD.c
--- a/src/Virt_RASD.c Fri Mar 07 15:24:38 2008 -0800
+++ b/src/Virt_RASD.c Mon Mar 10 14:40:47 2008 +0100
@@ -562,32 +562,16 @@ static CMPIStatus _enum_rasds(const CMPI
struct inst_list *list)
{
CMPIStatus s;
+ int i;
if (type == CIM_RES_TYPE_ALL) {
- s = _get_rasds(broker,
- reference,
- dom,
- CIM_RES_TYPE_PROC,
- properties,
- list);
- s = _get_rasds(broker,
- reference,
- dom,
- CIM_RES_TYPE_MEM,
- properties,
- list);
- s = _get_rasds(broker,
- reference,
- dom,
- CIM_RES_TYPE_NET,
- properties,
- list);
- s = _get_rasds(broker,
- reference,
- dom,
- CIM_RES_TYPE_DISK,
- properties,
- list);
+ for (i=0; i<CIM_RES_TYPE_COUNT; i++)
+ s = _get_rasds(broker,
+ reference,
+ dom,
+ cim_res_types[i],
+ properties,
+ list);
}
else
s = _get_rasds(broker,
diff -r f82efd4364f1 -r 1325969aff7f src/svpc_types.h
--- a/src/svpc_types.h Fri Mar 07 15:24:38 2008 -0800
+++ b/src/svpc_types.h Mon Mar 10 14:40:47 2008 +0100
@@ -30,6 +30,14 @@
#define CIM_RES_TYPE_EMU 1
#define CIM_RES_TYPE_GRAPHICS 24
#define CIM_RES_TYPE_UNKNOWN 1000
+
+#define CIM_RES_TYPE_COUNT 4
+const static int cim_res_types[CIM_RES_TYPE_COUNT] =
+ {CIM_RES_TYPE_NET,
+ CIM_RES_TYPE_DISK,
+ CIM_RES_TYPE_MEM,
+ CIM_RES_TYPE_PROC,
+ };
#define CIM_VSSD_RECOVERY_NONE 2
#define CIM_VSSD_RECOVERY_RESTART 3
16 years, 9 months