# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1201630446 28800
# Node ID d620c3b248bce27b2180634b8f1fa8f6742198bd
# Parent f3cfa71adbdf5f4e6d92357a28acf41f1e901f69
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 f3cfa71adbdf -r d620c3b248bc schema/VSMigrationService.mof
--- a/schema/VSMigrationService.mof Mon Jan 28 07:27:52 2008 -0800
+++ b/schema/VSMigrationService.mof Tue Jan 29 10:14:06 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 f3cfa71adbdf -r d620c3b248bc src/Virt_VSMigrationService.c
--- a/src/Virt_VSMigrationService.c Mon Jan 28 07:27:52 2008 -0800
+++ b/src/Virt_VSMigrationService.c Tue Jan 29 10:14:06 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},