[Libvirt-cim] [PATCH] Workaround for Pegasus ObjectPath issue

Sharad Mishra snmishra at us.ibm.com
Thu May 27 22:00:06 UTC 2010


# HG changeset patch
# User Sharad Mishra <snmishra at us.ibm.com>
# Date 1274997567 25200
# Node ID 49781459fdcfb5cd91eb7c1e99701d663d5b53eb
# Parent  8b1793add36c7e72933c2f8f04c400fa9d3b8910
Workaround for Pegasus ObjectPath issue.

Pegasus loses its object path after a call to CMGetObjectPath.
This patch adds the object path back to indication.

Signed-off-by: Sharad Mishra <snmishra at us.ibm.com>

diff -r 8b1793add36c -r 49781459fdcf src/Virt_ResourceAllocationSettingDataIndication.c
--- a/src/Virt_ResourceAllocationSettingDataIndication.c	Thu May 27 14:09:56 2010 -0700
+++ b/src/Virt_ResourceAllocationSettingDataIndication.c	Thu May 27 14:59:27 2010 -0700
@@ -113,6 +113,10 @@
         args->classname = strdup(CLASSNAME(ref));
         args->_ctx = _ctx;
 
+        /* This is a workaround for Pegasus, it loses its objectpath by
+           CMGetObjectPath. So set it back. */
+        ind->ft->setObjectPath((CMPIInstance *)ind, ref);
+
         s = stdi_deliver(broker, ctx, args, (CMPIInstance *)ind);
         if (s.rc == CMPI_RC_OK) {
                 CU_DEBUG("Indication delivered");
diff -r 8b1793add36c -r 49781459fdcf src/Virt_VSMigrationService.c
--- a/src/Virt_VSMigrationService.c	Thu May 27 14:09:56 2010 -0700
+++ b/src/Virt_VSMigrationService.c	Thu May 27 14:59:27 2010 -0700
@@ -757,6 +757,11 @@
         ind_name = ind_type_to_name(ind_type);
 
         ref = CMGetObjectPath(inst, &s);
+
+        /* This is a workaround for Pegasus, it loses its objectpath by
+           CMGetObjectPath. So set it back. */
+        inst->ft->setObjectPath((CMPIInstance *)inst, ref);
+
         if ((ref == NULL) || (s.rc != CMPI_RC_OK)) {
                 CU_DEBUG("Failed to get job reference");
         } else {




More information about the Libvirt-cim mailing list