Kaitlin Rupert <kaitlin@linux.vnet.ibm.com>
Sent by: libvirt-cim-bounces@redhat.com
06/26/2009 04:57 PM
Please respond to
List for discussion and development of libvirt CIM <libvirt-cim@redhat.com>
To
libvirt-cim@redhat.com
cc
Subject
[Libvirt-cim] [PATCH 2 of 2] Modify _do_instance() so that is takes a previous instance param
# HG changeset patch
# User Kaitlin Rupert <karupert@us.ibm.com>
# Date 1246060597 25200
# Node ID 00047bd35641e678e3b7fb0832e5aa8ec4b7a8dd
# Parent 6b1f7181f1633e456bc7e90c09f7943588c28865
Modify _do_instance() so that is takes a previous instance param
This change is needed so that we can pass in an instance that represents
the guest prior to the modification.
Currently, we don't have a way to get the previous state of the guest from the
event loop. This change is a necessary first step for providing that
functionality.
- /* FIXME: This gets the CS instance after it has been modified. We also
- need a way to get the instance before it was modified - that
- value is used when setting the PreviousInstance value. */
s = get_domain_by_name(_BROKER, op, name, &affected_inst);
if (s.rc != CMPI_RC_OK)
goto out;
+ /* FIXME: We are unable to get the previous CS instance after it has
+ been modified. Consider keeping track of the previous
+ state in the place we keep track of the requested state */
+ prev_inst = affected_inst;
+
CMSetProperty(affected_inst, "Name",
(CMPIValue *)name, CMPI_chars);
CMSetProperty(affected_inst, "UUID",
(CMPIValue *)prev_dom.uuid, CMPI_chars);