# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1202248173 28800
# Node ID 4a3c49398498fc69bf1063bfdec45fa6fb553f32
# Parent 939ed8ed24f4842ddde6ca06bdcaaeab4168ff9b
Update SettingsDefineCapabilities so that it supports VSMigrationSettingData.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 939ed8ed24f4 -r 4a3c49398498 src/Makefile.am
--- a/src/Makefile.am Tue Feb 05 13:49:24 2008 -0800
+++ b/src/Makefile.am Tue Feb 05 13:49:33 2008 -0800
@@ -103,9 +103,12 @@ libVirt_ElementCapabilities_la_LIBADD =
-lVirt_VSMigrationCapabilities \
-lVirt_AllocationCapabilities
-libVirt_SettingsDefineCapabilities_la_DEPENDENCIES = libVirt_RASD.la
libVirt_DevicePool.la
+libVirt_SettingsDefineCapabilities_la_DEPENDENCIES = libVirt_RASD.la
libVirt_DevicePool.la libVirt_VSMigrationCapabilities.la
libVirt_VSMigrationSettingData.la
libVirt_SettingsDefineCapabilities_la_SOURCES = Virt_SettingsDefineCapabilities.c
-libVirt_SettingsDefineCapabilities_la_LIBADD = -lVirt_RASD -lVirt_DevicePool
+libVirt_SettingsDefineCapabilities_la_LIBADD = -lVirt_RASD \
+ -lVirt_DevicePool \
+ -lVirt_VSMigrationCapabilities \
+ -lVirt_VSMigrationSettingData
libVirt_RegisteredProfile_la_SOURCES = Virt_RegisteredProfile.c
diff -r 939ed8ed24f4 -r 4a3c49398498 src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Tue Feb 05 13:49:24 2008 -0800
+++ b/src/Virt_SettingsDefineCapabilities.c Tue Feb 05 13:49:33 2008 -0800
@@ -43,6 +43,8 @@
#include "Virt_SettingsDefineCapabilities.h"
#include "Virt_DevicePool.h"
#include "Virt_RASD.h"
+#include "Virt_VSMigrationCapabilities.h"
+#include "Virt_VSMigrationSettingData.h"
const static CMPIBroker *_BROKER;
@@ -825,6 +827,50 @@ static CMPIStatus rasd_to_alloc_cap(cons
RETURN_UNSUPPORTED();
}
+static CMPIStatus migrate_cap_to_vsmvs(const CMPIObjectPath *ref,
+ struct std_assoc_info *info,
+ struct inst_list *list)
+{
+ CMPIStatus s = {CMPI_RC_OK};
+ CMPIInstance *inst;
+
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
+
+ s = get_migration_caps(ref, &inst, _BROKER);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
+
+ s = get_migration_sd(ref, &inst, _BROKER, false);
+ if (s.rc == CMPI_RC_OK)
+ inst_list_add(list, inst);
+
+ out:
+ return s;
+}
+
+static CMPIStatus vsmvs_to_migrate_cap(const CMPIObjectPath *ref,
+ struct std_assoc_info *info,
+ struct inst_list *list)
+{
+ CMPIStatus s = {CMPI_RC_OK};
+ CMPIInstance *inst;
+
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
+
+ s = get_migration_sd(ref, &inst, _BROKER, true);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
+
+ s = get_migration_caps(ref, &inst, _BROKER);
+ if (s.rc == CMPI_RC_OK)
+ inst_list_add(list, inst);
+
+ out:
+ return s;
+}
+
LIBVIRT_CIM_DEFAULT_MAKEREF()
static char* group_component[] = {
@@ -877,9 +923,49 @@ static struct std_assoc _rasd_to_alloc_c
.make_ref = make_ref
};
+static char* migrate_cap[] = {
+ "Xen_VirtualSystemMigrationCapabilities",
+ "KVM_VirtualSystemMigrationCapabilities",
+ NULL
+};
+
+static char* migrate_sd[] = {
+ "Xen_VirtualSystemMigrationSettingData",
+ "KVM_VirtualSystemMigrationSettingData",
+ NULL
+};
+
+static struct std_assoc _migrate_cap_to_vsmvs = {
+ .source_class = (char**)&migrate_cap,
+ .source_prop = "GroupComponent",
+
+ .target_class = (char**)&migrate_sd,
+ .target_prop = "PartComponent",
+
+ .assoc_class = (char**)&assoc_classname,
+
+ .handler = migrate_cap_to_vsmvs,
+ .make_ref = make_ref
+};
+
+static struct std_assoc _vsmvs_to_migrate_cap = {
+ .source_class = (char**)&migrate_sd,
+ .source_prop = "PartComponent",
+
+ .target_class = (char**)&migrate_cap,
+ .target_prop = "GroupComponent",
+
+ .assoc_class = (char**)&assoc_classname,
+
+ .handler = vsmvs_to_migrate_cap,
+ .make_ref = make_ref
+};
+
static struct std_assoc *assoc_handlers[] = {
&_alloc_cap_to_rasd,
&_rasd_to_alloc_cap,
+ &_migrate_cap_to_vsmvs,
+ &_vsmvs_to_migrate_cap,
NULL
};