# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1197681878 28800
# Node ID 5339f01a786a287ed6f2c49b47704fd99db6432a
# Parent 72b93a4339e1c13080d6a6d80a580a7742c0b851
Fix VSMigrationService NULL key attributes.
The SystemCreationClassName and SystemName keys are NULL, these should be set.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 72b93a4339e1 -r 5339f01a786a src/Virt_VSMigrationService.c
--- a/src/Virt_VSMigrationService.c Fri Dec 14 10:37:01 2007 +0100
+++ b/src/Virt_VSMigrationService.c Fri Dec 14 17:24:38 2007 -0800
@@ -36,6 +36,7 @@
#include <libcmpiutil/std_invokemethod.h>
#include "Virt_VSMigrationService.h"
+#include "Virt_HostSystem.h"
#define CIM_JOBSTATE_STARTING 3
#define CIM_JOBSTATE_RUNNING 4
@@ -639,6 +640,12 @@ CMPIStatus get_migration_service(const C
{
CMPIInstance *inst;
CMPIStatus s = {CMPI_RC_OK, NULL};
+ CMPIInstance *host = NULL;
+ const char *val = NULL;
+
+ s = get_host_cs(broker, ref, &host);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
inst = get_typed_instance(broker,
CLASSNAME(ref),
@@ -654,8 +661,30 @@ CMPIStatus get_migration_service(const C
CMSetProperty(inst, "Name",
(CMPIValue *)"MigrationService", CMPI_chars);
+ if (cu_get_str_prop(host, "Name", &val) != CMPI_RC_OK) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Unable to get name of HostSystem");
+ goto out;
+ }
+
+ CMSetProperty(inst, "SystemName",
+ (CMPIValue *)val, CMPI_chars);
+
+ if (cu_get_str_prop(host, "CreationClassName", &val) != CMPI_RC_OK)
{
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Unable to get creation class of HostSystem");
+ goto out;
+ }
+
+ CMSetProperty(inst, "SystemCreationClassName",
+ (CMPIValue *)val, CMPI_chars);
+
+
*_inst = inst;
+ out:
return s;
}