+1
Sharad Mishra
System x Enablement
Linux Technology Center
IBM
Kaitlin Rupert
<kaitlin(a)linux.vn
et.ibm.com> To
Sent by: libvirt-cim(a)redhat.com
libvirt-cim-bounc cc
es(a)redhat.com
Subject
[Libvirt-cim] [PATCH 1 of 2] Remove
06/26/2009 04:57 type_name param from
PM _do_indication in CSIndication
Please respond to
List for
discussion and
development of
libvirt CIM
<libvirt-cim@redh
at.com>
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1246060573 25200
# Node ID 6b1f7181f1633e456bc7e90c09f7943588c28865
# Parent f1f435da7db3230365969a7abdbeeff9ef154676
Remove type_name param from _do_indication in CSIndication
No reason to pass the indication name if we're already passing the
indication
type.
Also, remove the call to set the AffectedSystem property. This property
doesn't
exist in any of the Indications classes in the 2.21 schema - also doesn't
exist in our own local schema. Not sure why this value was being set,
doesn't
appear to be a property in the 2.16 schema either.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r f1f435da7db3 -r 6b1f7181f163 src/Virt_ComputerSystemIndication.c
--- a/src/Virt_ComputerSystemIndication.c Wed Jun 24 10:27:16 2009
-0700
+++ b/src/Virt_ComputerSystemIndication.c Fri Jun 26 16:56:13 2009
-0700
@@ -224,16 +224,28 @@
const CMPIContext *ctx,
CMPIInstance *affected_inst,
int ind_type,
- const char *ind_type_name,
char *prefix,
struct ind_args *args)
{
+ const char *ind_type_name = NULL;
CMPIObjectPath *affected_op;
CMPIObjectPath *ind_op;
CMPIInstance *ind;
CMPIStatus s;
bool ret = true;
+ switch (ind_type) {
+ case CS_CREATED:
+ ind_type_name = "ComputerSystemCreatedIndication";
+ break;
+ case CS_DELETED:
+ ind_type_name = "ComputerSystemDeletedIndication";
+ break;
+ case CS_MODIFIED:
+ ind_type_name = "ComputerSystemModifiedIndication";
+ break;
+ }
+
ind = get_typed_instance(broker,
prefix,
ind_type_name,
@@ -265,16 +277,9 @@
}
CMSetNameSpace(affected_op, args->ns);
- switch (ind_type) {
- case CS_CREATED:
- case CS_DELETED:
- CMSetProperty(ind, "AffectedSystem",
- (CMPIValue *)&affected_op, CMPI_ref);
- break;
- case CS_MODIFIED:
+ if (ind_type == CS_MODIFIED) {
CMSetProperty(ind, "PreviousInstance",
(CMPIValue *)&affected_inst, CMPI_instance);
- break;
}
CMSetProperty(ind, "SourceInstance",
@@ -333,7 +338,6 @@
{
bool rc = false;
char *name = NULL;
- char *type_name = NULL;
char *cn = NULL;
CMPIObjectPath *op;
CMPIInstance *affected_inst;
@@ -364,25 +368,13 @@
if (s.rc != CMPI_RC_OK)
goto out;
- switch (ind_type) {
- case CS_CREATED:
- type_name = "ComputerSystemCreatedIndication";
- break;
- case CS_DELETED:
- type_name = "ComputerSystemDeletedIndication";
- break;
- case CS_MODIFIED:
- type_name = "ComputerSystemModifiedIndication";
- break;
- }
-
CMSetProperty(affected_inst, "Name",
(CMPIValue *)name, CMPI_chars);
CMSetProperty(affected_inst, "UUID",
(CMPIValue *)prev_dom.uuid, CMPI_chars);
rc = _do_indication(_BROKER, context, affected_inst,
- ind_type, type_name, prefix, args);
+ ind_type, prefix, args);
out:
free(cn);
_______________________________________________
Libvirt-cim mailing list
Libvirt-cim(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim