[Libvirt-cim] [PATCH] Set the SourceInstanceHost property in migration indications

Dan Smith danms at us.ibm.com
Tue Jul 1 21:20:47 UTC 2008


# HG changeset patch
# User Dan Smith <danms at us.ibm.com>
# Date 1214947245 25200
# Node ID 4565972096b56353938ea30813b6c780e8488e65
# Parent  cb343a986592c25c487c53042ad889fa24ea9d97
Set the SourceInstanceHost property in migration indications

This is a total hack at the moment, because we don't persist any
platform details in the job (since only Xen is supported at the moment).
When we do, this can be cleaned up.  However, it works for now and would
be good to get in place.

Signed-off-by: Dan Smith <danms at us.ibm.com>

diff -r cb343a986592 -r 4565972096b5 src/Virt_VSMigrationService.c
--- a/src/Virt_VSMigrationService.c	Tue Jul 01 12:47:31 2008 -0700
+++ b/src/Virt_VSMigrationService.c	Tue Jul 01 14:20:45 2008 -0700
@@ -712,12 +712,29 @@
 {
         char *type;
         CMPIStatus s;
+        CMPIObjectPath *ref;
         const char *ind_name = NULL;
+        const char *host = NULL;
+        const char *ccname = NULL;
 
         if (ind == NULL)
                 return false;
 
         ind_name = ind_type_to_name(ind_type);
+
+        /* FIXME: This is a hack until we un-Xenify this provider */
+        ref = CMNewObjectPath(_BROKER, ns, "Xen_Foo", &s);
+        if (s.rc == CMPI_RC_OK) {
+                s = get_host_system_properties(&host, &ccname, ref, _BROKER);
+                if (s.rc == CMPI_RC_OK) {
+                        CMSetProperty(ind, "SourceInstanceHost",
+                                      (CMPIValue *)host, CMPI_chars);
+                } else {
+                        CU_DEBUG("Unable to get HostSystem properties");
+                }
+        } else {
+                CU_DEBUG("Failed to get job reference");
+        }
 
         CU_DEBUG("Setting SourceInstance");
         CMSetProperty(ind, "SourceInstance",




More information about the Libvirt-cim mailing list