[PATCH] Add DestinationHostFormatsSupported to VSMigrationCapabilities
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1205458680 25200
# Node ID f46db9de4778069c5cb0c5b7183944d3fbd4370b
# Parent 8a689c81d44016468f58f10df8026f729c1cb2aa
Add DestinationHostFormatsSupported to VSMigrationCapabilities.
libvirt reports that it support IPv6, although I have not tested it. But I'm including it in our supported host list.
>From the mof, we have:
"DomainNameFormatSupported",
"IPv4DottedDecimalFormatSupported",
"IPv6TextFormatSupported",
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 8a689c81d440 -r f46db9de4778 src/Virt_VSMigrationCapabilities.c
--- a/src/Virt_VSMigrationCapabilities.c Thu Mar 13 17:09:57 2008 -0700
+++ b/src/Virt_VSMigrationCapabilities.c Thu Mar 13 18:38:00 2008 -0700
@@ -39,6 +39,10 @@ const static CMPIBroker *_BROKER;
#define SVPC_MIG_CVSIMTH 4
#define SVPC_MIG_CVSIMTS 5
+#define SVPC_MIG_DOMAIN 2
+#define SVPC_MIG_IPv4 3
+#define SVPC_MIG_IPv6 4
+
static CMPIStatus set_method_properties(const CMPIBroker *broker,
CMPIInstance *inst)
{
@@ -76,6 +80,36 @@ static CMPIStatus set_method_properties(
cu_statusf(broker, &s,
CMPI_RC_OK,
"");
+ return s;
+}
+
+static CMPIStatus set_formats_property(const CMPIBroker *broker,
+ CMPIInstance *inst)
+{
+ CMPIArray *array;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+ uint16_t val;
+
+ array = CMNewArray(broker, 3, CMPI_uint16, &s);
+ if (s.rc != CMPI_RC_OK) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "CMNewArray() call failed.");
+ return s;
+ }
+
+ val = SVPC_MIG_DOMAIN;
+ CMSetArrayElementAt(array, 0, (CMPIValue *)&val, CMPI_uint16);
+
+ val = SVPC_MIG_IPv4;
+ CMSetArrayElementAt(array, 1, (CMPIValue *)&val, CMPI_uint16);
+
+ val = SVPC_MIG_IPv6;
+ CMSetArrayElementAt(array, 2, (CMPIValue *)&val, CMPI_uint16);
+
+ CMSetProperty(inst, "DestinationHostFormatsSupported",
+ (CMPIValue *)&array, CMPI_uint16A);
+
return s;
}
@@ -113,6 +147,10 @@ CMPIStatus get_migration_caps(const CMPI
s = set_method_properties(broker, inst);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
+
+ s = set_formats_property(broker, inst);
if (s.rc != CMPI_RC_OK)
goto out;
16 years, 9 months
[PATCH] Fix bizarre crash in VSMigrationService
by Jay Gagnon
# HG changeset patch
# User Jay Gagnon <grendel(a)linux.vnet.ibm.com>
# Date 1205334578 14400
# Node ID 24baa607951031ef22b5263742135bef9f24d29b
# Parent b739fc9b13320e07a39f3932396c8411c2d4ad75
Fix bizarre crash in VSMigrationService
Apparently I was the only one seeing this, but I hit a very strange bug in Virt_VSMigrationService. It would just totally implode whenever I tried to migrate a system. It was eventually tracked down to the transport member of the migration_job struct; for some reason if that member (which we don't even use anymore) is removed everything works perfectly. This might bear more investigation, but for the time being the fix should at least be put in.
Signed-off-by: Jay Gagnon <grendel(a)linux.vnet.ibm.com>
diff -r b739fc9b1332 -r 24baa6079510 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 11:09:38 2008 -0400
@@ -64,7 +64,6 @@ struct migration_job {
char *ref_cn;
char *ref_ns;
uint16_t type;
- uint16_t transport;
char uuid[33];
};
16 years, 9 months
[PATCH] (#2) Use live migration if MigrationType isn't defined in MSD
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1205417729 25200
# Node ID 388332fc798482beb0349785003097054c4867dc
# Parent b739fc9b13320e07a39f3932396c8411c2d4ad75
(#2) Use live migration if MigrationType isn't defined in MSD.
Updates:
- Added DCO.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r b739fc9b1332 -r 388332fc7984 src/Virt_VSMigrationService.c
--- a/src/Virt_VSMigrationService.c Tue Mar 11 13:28:04 2008 -0700
+++ b/src/Virt_VSMigrationService.c Thu Mar 13 07:15:29 2008 -0700
@@ -100,9 +100,8 @@ static CMPIStatus get_migration_type(CMP
ret = cu_get_u16_prop(msd, "MigrationType", type);
if (ret != CMPI_RC_OK) {
- cu_statusf(_BROKER, &s,
- ret,
- "Invalid MigrationType value");
+ CU_DEBUG("Using default MigrationType: %d", CIM_MIGRATE_LIVE);
+ *type = CIM_MIGRATE_LIVE;
}
return s;
16 years, 9 months
[PATCH] (#2) Add domain ref checking to isMigratable
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1205365783 25200
# Node ID c655c11291a0817c4a804f41bcaa64bbcd34efc5
# Parent b739fc9b13320e07a39f3932396c8411c2d4ad75
(#2) Add domain ref checking to isMigratable
Tested by adding an invalid key to the ComputerSystem REF, which would
pass before. It now fails and points out the offending key, as expected.
Changes:
- Link to libVirt_ComputerSystem
- Use the proper ref and set the namespace, since it's not done for us
- Move the Name key extraction up a level to reduce duplication and make
the CS ref available for the get_domain_by_ref() call
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r b739fc9b1332 -r c655c11291a0 src/Makefile.am
--- a/src/Makefile.am Tue Mar 11 13:28:04 2008 -0700
+++ b/src/Makefile.am Wed Mar 12 16:49:43 2008 -0700
@@ -163,9 +163,9 @@ libVirt_ElementSettingData_la_LIBADD = -
libVirt_VSMigrationCapabilities_la_SOURCES = Virt_VSMigrationCapabilities.c
-libVirt_VSMigrationService_la_DEPENDENCIES = libVirt_HostSystem.la libVirt_VSMigrationSettingData.la
+libVirt_VSMigrationService_la_DEPENDENCIES = libVirt_HostSystem.la libVirt_VSMigrationSettingData.la libVirt_ComputerSystem.la
libVirt_VSMigrationService_la_SOURCES = Virt_VSMigrationService.c
-libVirt_VSMigrationService_la_LIBADD = -lVirt_HostSystem -lVirt_VSMigrationSettingData
+libVirt_VSMigrationService_la_LIBADD = -lVirt_HostSystem -lVirt_VSMigrationSettingData -lVirt_ComputerSystem
libVirt_VSMigrationSettingData_la_SOURCES = Virt_VSMigrationSettingData.c
diff -r b739fc9b1332 -r c655c11291a0 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 16:49:43 2008 -0700
@@ -38,6 +38,7 @@
#include "Virt_VSMigrationService.h"
#include "Virt_HostSystem.h"
+#include "Virt_ComputerSystem.h"
#include "Virt_VSMigrationSettingData.h"
#define CIM_JOBSTATE_STARTING 3
@@ -263,7 +264,7 @@ static CMPIStatus check_hver(virConnectP
}
static CMPIStatus vs_migratable(const CMPIObjectPath *ref,
- const char *domain,
+ CMPIObjectPath *system,
const char *destination,
const CMPIResult *results,
const CMPIArgs *argsin,
@@ -276,6 +277,15 @@ static CMPIStatus vs_migratable(const CM
CMPIBoolean isMigratable = 0;
uint16_t type;
virDomainPtr dom = NULL;
+ CMPIInstance *dominst;
+ const char *domain;
+
+ if (cu_get_str_path(system, "Name", &domain) != CMPI_RC_OK) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Missing key (Name) in ComputerSystem");
+ goto out;
+ }
s = get_msd_values(ref, destination, argsin, &type, &dconn);
if (s.rc != CMPI_RC_OK)
@@ -296,6 +306,11 @@ static CMPIStatus vs_migratable(const CM
"No such domain");
goto out;
}
+
+ CMSetNameSpace(system, NAMESPACE(ref));
+ s = get_domain_by_ref(_BROKER, system, &dominst);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
s = check_caps(conn, dconn);
if (s.rc != CMPI_RC_OK)
@@ -329,18 +344,9 @@ static CMPIStatus vs_migratable_host(CMP
CMPIStatus s;
const char *dhost = NULL;
CMPIObjectPath *system;
- const char *name = NULL;
cu_get_str_arg(argsin, "DestinationHost", &dhost);
cu_get_ref_arg(argsin, "ComputerSystem", &system);
-
- if (cu_get_str_path(system, "Name", &name) != CMPI_RC_OK) {
- cu_statusf(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Missing key (Name) in ComputerSystem");
- METHOD_RETURN(results, 1);
- return s;
- }
if (!check_refs_pfx_match(ref, system)) {
cu_statusf(_BROKER, &s,
@@ -350,7 +356,7 @@ static CMPIStatus vs_migratable_host(CMP
return s;
}
- return vs_migratable(ref, name, dhost, results, argsin, argsout);
+ return vs_migratable(ref, system, dhost, results, argsin, argsout);
}
static CMPIStatus vs_migratable_system(CMPIMethodMI *self,
@@ -364,7 +370,6 @@ static CMPIStatus vs_migratable_system(C
CMPIObjectPath *dsys;
CMPIObjectPath *sys;
const char *dname;
- const char *name;
cu_get_ref_arg(argsin, "DestinationSystem", &dsys);
cu_get_ref_arg(argsin, "ComputerSystem", &sys);
@@ -377,14 +382,6 @@ static CMPIStatus vs_migratable_system(C
return s;
}
- if (cu_get_str_path(sys, "Name", &name) != CMPI_RC_OK) {
- cu_statusf(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Missing key (Name) in ComputerSystem");
- METHOD_RETURN(results, 1);
- return s;
- }
-
if (!check_refs_pfx_match(ref, sys)) {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
@@ -393,7 +390,7 @@ static CMPIStatus vs_migratable_system(C
return s;
}
- return vs_migratable(ref, name, dname, results, argsin, argsout);
+ return vs_migratable(ref, sys, dname, results, argsin, argsout);
}
static const char *ind_type_to_name(int ind_type)
16 years, 9 months
[PATCH] Use live migration if MigrationType isn't defined in MSD
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1205362434 25200
# Node ID df3c20a332e01e4e9f90f6ccdc61857515d57a7f
# Parent b739fc9b13320e07a39f3932396c8411c2d4ad75
Use live migration if MigrationType isn't defined in MSD.
diff -r b739fc9b1332 -r df3c20a332e0 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 15:53:54 2008 -0700
@@ -100,9 +100,8 @@ static CMPIStatus get_migration_type(CMP
ret = cu_get_u16_prop(msd, "MigrationType", type);
if (ret != CMPI_RC_OK) {
- cu_statusf(_BROKER, &s,
- ret,
- "Invalid MigrationType value");
+ CU_DEBUG("Using default MigrationType: %d", CIM_MIGRATE_LIVE);
+ *type = CIM_MIGRATE_LIVE;
}
return s;
16 years, 9 months
[PATCH 0 of 3] [RFC] Add external migration checks
by Dan Smith
This set adds external check support to VSMigration service
Any executable in the MIG_CHECK_DIR is executed during the CheckVSIsMigratable()
method. If it returns 0, the check continues, nonzero and an error is
reported to the client. If the client puts anything in the CheckParams[] field,
the method writes these out to a temporary file and passes the filename on the
command-line to the check programs.
Migration checks are given MIG_CHECK_TIMEOUT (=10 sec by default) to get their
business done, otherwise they are killed and we report failure. This avoids
letting the checks block the CIMOM for too long.
Comments appreciated.
16 years, 9 months
[PATCH] Make migration return proper value for "Job Started"
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)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(a)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>
16 years, 9 months
[PATCH] Add domain ref checking to isMigratable
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1205340424 25200
# Node ID 42b808d88849cbc642af67b2769b120624f66a42
# Parent b739fc9b13320e07a39f3932396c8411c2d4ad75
Add domain ref checking to isMigratable
Tested by adding an invalid key to the ComputerSystem REF, which would
pass before. It now fails and points out the offending key, as expected.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r b739fc9b1332 -r 42b808d88849 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 09:47:04 2008 -0700
@@ -38,6 +38,7 @@
#include "Virt_VSMigrationService.h"
#include "Virt_HostSystem.h"
+#include "Virt_ComputerSystem.h"
#include "Virt_VSMigrationSettingData.h"
#define CIM_JOBSTATE_STARTING 3
@@ -276,6 +277,7 @@ static CMPIStatus vs_migratable(const CM
CMPIBoolean isMigratable = 0;
uint16_t type;
virDomainPtr dom = NULL;
+ CMPIInstance *dominst;
s = get_msd_values(ref, destination, argsin, &type, &dconn);
if (s.rc != CMPI_RC_OK)
@@ -296,6 +298,10 @@ static CMPIStatus vs_migratable(const CM
"No such domain");
goto out;
}
+
+ s = get_domain_by_ref(_BROKER, ref, &dominst);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
s = check_caps(conn, dconn);
if (s.rc != CMPI_RC_OK)
16 years, 9 months