[Libvirt-cim] [PATCH] Add DestinationHostFormatsSupported to VSMigrationCapabilities

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Fri Mar 14 01:42:42 UTC 2008


# HG changeset patch
# User Kaitlin Rupert <karupert at 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 at 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;
 




More information about the Libvirt-cim mailing list