[Libvirt-cim] [PATCH] Patch to fix property value for PreviousInstance

Sharad Mishra snmishra at us.ibm.com
Wed Sep 16 18:50:23 UTC 2009


# HG changeset patch
# User Sharad Mishra <snmishra at us.ibm.com>
# Date 1253126961 25200
# Node ID fc50acd35fe7f344e296441a88a00f42a7636ad6
# Parent  335b5e307df79e4e4cfdfc15d13424c759da8b53
Patch to fix property value for PreviousInstance.

When resource(s) are modified, "PreviousInstance" is set with the original instance. This property was incorrectly being set. This patch moves the code block to get this property before the instance in modified.

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

diff -r 335b5e307df7 -r fc50acd35fe7 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c	Tue Sep 15 09:19:18 2009 -0700
+++ b/src/Virt_VirtualSystemManagementService.c	Wed Sep 16 11:49:21 2009 -0700
@@ -2268,6 +2268,17 @@
                 goto out;
         }
 
+        if (func == &resource_add) {
+                indication = strdup(RASD_IND_CREATED);
+        }
+        else if (func == &resource_del) {
+                indication = strdup(RASD_IND_DELETED);
+        }
+        else {
+                indication = strdup(RASD_IND_MODIFIED);
+                prev_inst = get_previous_instance(dominfo, ref, type, devid);
+        }
+
         s = func(dominfo, rasd, type, devid, NAMESPACE(ref));
         if (s.rc != CMPI_RC_OK) {
                 CU_DEBUG("Resource transform function failed");
@@ -2279,17 +2290,6 @@
                 CU_DEBUG("New XML:\n%s", xml);
                 connect_and_create(xml, ref, &s);
 
-                if (func == &resource_add) {
-                        indication = strdup(RASD_IND_CREATED);
-                }
-                else if (func == &resource_del) {
-                        indication = strdup(RASD_IND_DELETED);
-                }
-                else {
-                        indication = strdup(RASD_IND_MODIFIED);
-                        prev_inst = get_previous_instance(dominfo, ref, type, devid);
-                }
-
                 if (inst_list_add(&list, rasd) == 0) {
                         CU_DEBUG("Unable to add RASD instance to the list\n");
                         goto out;




More information about the Libvirt-cim mailing list