# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1204238360 28800
# Node ID e9f9fe648fac4642db1607c27bd916ee71d2e479
# Parent b5577ad78998fcf535b94ca0d2a1e8730720f3cf
Update SDC so that it supports VSMigrationSettingData to VSMigrationCapabilities.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r b5577ad78998 -r e9f9fe648fac src/Makefile.am
--- a/src/Makefile.am Thu Feb 28 10:30:05 2008 -0800
+++ b/src/Makefile.am Thu Feb 28 14:39:20 2008 -0800
@@ -111,9 +111,12 @@ libVirt_ElementCapabilities_la_LIBADD =
-lVirt_VirtualSystemManagementService \
-lVirt_VSMigrationService
-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 b5577ad78998 -r e9f9fe648fac src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Thu Feb 28 10:30:05 2008 -0800
+++ b/src/Virt_SettingsDefineCapabilities.c Thu Feb 28 14:39:20 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_vsmsd(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, true);
+ 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 vsmsd_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, false);
+ 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_vsmsd = {
+ .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_vsmsd,
+ .make_ref = make_ref
+};
+
+static struct std_assoc _vsmsd_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 = vsmsd_to_migrate_cap,
+ .make_ref = make_ref
+};
+
static struct std_assoc *assoc_handlers[] = {
&_alloc_cap_to_rasd,
&_rasd_to_alloc_cap,
+ &_migrate_cap_to_vsmsd,
+ &_vsmsd_to_migrate_cap,
NULL
};