# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1201708774 28800
# Node ID 582dbca831385ad2221128e2ae7189fd15691102
# Parent 1edd65bed40d4f560942eee3e9bec25515a09770
Fix migration schema per Jim's comment (from months ago)
As a result, change the migratable checks to return a boolean
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 1edd65bed40d -r 582dbca83138 schema/VSMigrationService.mof
--- a/schema/VSMigrationService.mof Wed Jan 30 12:42:52 2008 +0100
+++ b/schema/VSMigrationService.mof Wed Jan 30 07:59:34 2008 -0800
@@ -3,34 +3,66 @@
// Placeholder definition until schema is available upstream
class CIM_VirtualSystemMigrationService : CIM_Service {
- uint32 VirtualSystemIsMigratableToHost(
- [Out]
- CIM_ConcreteJob REF Job,
- [In, EmbeddedInstance("CIM_ResourceAllocationSettingData")]
- string NewResourceSettingData[],
+ uint32 CheckVirtualSystemIsMigratableToHost(
+ [In]
+ CIM_ComputerSystem REF ComputerSystem,
+ [In]
+ string DestinationHost,
[In, EmbeddedInstance("CIM_SettingData")]
string MigrationSettingData,
[In, EmbeddedInstance("CIM_VirtualSystemSettingData")]
string NewSystemSettingData,
+ [In, EmbeddedInstance("CIM_ResourceAllocationSettingData")]
+ string NewResourceSettingData[],
+ [Out]
+ boolean IsMigratable
+ );
+
+ uint32 CheckVirtualSystemIsMigratableToSystem(
[In]
CIM_ComputerSystem REF ComputerSystem,
[In]
- string DestinationHost);
-
- uint32 MigrateVirtualSystemToHost(
- [Out]
- CIM_ConcreteJob REF Job,
- [In, EmbeddedInstance("CIM_ResourceAllocationSettingData")]
- string NewResourceSettingData[],
+ CIM_System REF DestinationSystem,
[In, EmbeddedInstance("CIM_SettingData")]
string MigrationSettingData,
[In, EmbeddedInstance("CIM_VirtualSystemSettingData")]
string NewSystemSettingData,
+ [In, EmbeddedInstance("CIM_ResourceAllocationSettingData")]
+ string NewResourceSettingData[],
+ [Out]
+ boolean IsMigratable
+ );
+
+
+ uint32 MigrateVirtualSystemToHost(
[In]
CIM_ComputerSystem REF ComputerSystem,
[In]
- string DestinationHost);
+ string DestinationHost,
+ [In, EmbeddedInstance("CIM_SettingData")]
+ string MigrationSettingData,
+ [In, EmbeddedInstance("CIM_VirtualSystemSettingData")]
+ string NewSystemSettingData,
+ [In, EmbeddedInstance("CIM_ResourceAllocationSettingData")]
+ string NewResourceSettingData[],
+ [Out]
+ CIM_ConcreteJob REF Job
+ );
+ uint32 MigrateVirtualSystemToHost(
+ [In]
+ CIM_ComputerSystem REF ComputerSystem,
+ [In]
+ CIM_System REF DestinationSystem,
+ [In, EmbeddedInstance("CIM_SettingData")]
+ string MigrationSettingData,
+ [In, EmbeddedInstance("CIM_VirtualSystemSettingData")]
+ string NewSystemSettingData,
+ [In, EmbeddedInstance("CIM_ResourceAllocationSettingData")]
+ string NewResourceSettingData[],
+ [Out]
+ CIM_ConcreteJob REF Job
+ );
};
class Virt_MigrationJob : CIM_ConcreteJob {
diff -r 1edd65bed40d -r 582dbca83138 src/Virt_VSMigrationService.c
--- a/src/Virt_VSMigrationService.c Wed Jan 30 12:42:52 2008 +0100
+++ b/src/Virt_VSMigrationService.c Wed Jan 30 07:59:34 2008 -0800
@@ -131,13 +131,15 @@ static CMPIStatus vs_migratable(const CM
static CMPIStatus vs_migratable(const CMPIObjectPath *ref,
const char *domain,
const char *destination,
- const CMPIResult *results)
+ const CMPIResult *results,
+ CMPIArgs *argsout)
{
CMPIStatus s;
char *uri = NULL;
virConnectPtr conn = NULL;
virConnectPtr dconn = NULL;
uint32_t retcode = 1;
+ CMPIBoolean isMigratable = 0;
uri = dest_uri(CLASSNAME(ref), destination);
if (uri == NULL) {
@@ -173,6 +175,10 @@ static CMPIStatus vs_migratable(const CM
out:
CMReturnData(results, (CMPIValue *)&retcode, CMPI_uint32);
+
+ isMigratable = (retcode == 0);
+ CMAddArg(argsout, "IsMigratable",
+ (CMPIValue *)&isMigratable, CMPI_boolean);
free(uri);
virConnectClose(conn);
@@ -212,7 +218,7 @@ static CMPIStatus vs_migratable_host(CMP
return s;
}
- return vs_migratable(ref, name, dhost, results);
+ return vs_migratable(ref, name, dhost, results, argsout);
}
static CMPIStatus vs_migratable_system(CMPIMethodMI *self,
@@ -255,7 +261,7 @@ static CMPIStatus vs_migratable_system(C
return s;
}
- return vs_migratable(ref, name, dname, results);
+ return vs_migratable(ref, name, dname, results, argsout);
}
static void migrate_job_set_state(struct migration_job *job,
@@ -620,7 +626,7 @@ static CMPIStatus migrate_vs_system(CMPI
}
static struct method_handler vsimth = {
- .name = "VirtualSystemIsMigratableToHost",
+ .name = "CheckVirtualSystemIsMigratableToHost",
.handler = vs_migratable_host,
.args = {{"ComputerSystem", CMPI_ref},
{"DestinationHost", CMPI_string},
@@ -629,7 +635,7 @@ static struct method_handler vsimth = {
};
static struct method_handler vsimts = {
- .name = "VirtualSystemIsMigratableToSystem",
+ .name = "CheckVirtualSystemIsMigratableToSystem",
.handler = vs_migratable_system,
.args = {{"ComputerSystem", CMPI_ref},
{"DestinationSystem", CMPI_ref},