[Libvirt-cim] [PATCH] Set the properties of the SDC ref VSMigrationCap --> VSMigrationSD

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Tue Feb 3 22:36:12 UTC 2009


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1233700560 28800
# Node ID 3df2b62291003e0b446f7721c0f7b8b55279f142
# Parent  b8851323371c301a6357039b892bb8c1527a6b7d
Set the properties of the SDC ref VSMigrationCap --> VSMigrationSD

Set the PropertyPolicy, ValueRole, and ValueRange property values to indicate
the VSMigrationSD instance returned is the default instance.

Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>

diff -r b8851323371c -r 3df2b6229100 src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c	Tue Feb 03 10:52:08 2009 -0800
+++ b/src/Virt_SettingsDefineCapabilities.c	Tue Feb 03 14:36:00 2009 -0800
@@ -1119,6 +1119,32 @@
         return ref_inst;
 }
 
+static CMPIInstance *make_ref_msd(const CMPIObjectPath *source_ref,
+                                  const CMPIInstance *target_inst,
+                                  struct std_assoc_info *info,
+                                  struct std_assoc *assoc)
+{
+        CMPIInstance *ref_inst = NULL;
+        uint16_t ppolicy = SDC_POLICY_INDEPENDENT;
+        uint16_t valuerole = SDC_ROLE_DEFAULT;
+        uint16_t valuerange = SDC_RANGE_POINT;
+
+        ref_inst = make_reference(_BROKER,
+                                  source_ref,
+                                  target_inst,
+                                  info,
+                                  assoc);
+
+        CMSetProperty(ref_inst, "ValueRole",
+                      (CMPIValue *)&valuerole, CMPI_uint16);
+        CMSetProperty(ref_inst, "ValueRange",
+                      (CMPIValue *)&valuerange, CMPI_uint16);
+        CMSetProperty(ref_inst, "PropertyPolicy",
+                      (CMPIValue *)&ppolicy, CMPI_uint16);
+
+        return ref_inst;
+}
+
 LIBVIRT_CIM_DEFAULT_MAKEREF()
 
 static char* group_component[] = {
@@ -1207,7 +1233,7 @@
         .assoc_class = (char**)&assoc_classname,
 
         .handler = migrate_cap_to_vsmsd,
-        .make_ref = make_ref
+        .make_ref = make_ref_msd
 };
 
 static struct std_assoc _vsmsd_to_migrate_cap = {




More information about the Libvirt-cim mailing list