# HG changeset patch
# User Jay Gagnon <grendel(a)linux.vnet.ibm.com>
# Date 1202420324 18000
# Node ID a82dd87a3830eadda678b88bf4bfcfd4f8cb1ca4
# Parent c7dd4a8358a187a3469c3d8a177950625898a227
[RFC] Changes required to work with new std_indication. The trigger changes were very
light, which was nice.
Signed-off-by: Jay Gagnon <grendel(a)linux.vnet.ibm.com>
diff -r c7dd4a8358a1 -r a82dd87a3830 src/Virt_ComputerSystemIndication.c
--- a/src/Virt_ComputerSystemIndication.c Wed Feb 06 07:00:00 2008 -0800
+++ b/src/Virt_ComputerSystemIndication.c Thu Feb 07 16:38:44 2008 -0500
@@ -488,7 +488,8 @@ STDI_IndicationMIStub(,
Virt_ComputerSystemIndication,
_BROKER,
libvirt_cim_init(),
- &csi);
+ &csi,
+ NULL);
/*
* Local Variables:
diff -r c7dd4a8358a1 -r a82dd87a3830 src/Virt_ComputerSystemMigrationIndication.c
--- a/src/Virt_ComputerSystemMigrationIndication.c Wed Feb 06 07:00:00 2008 -0800
+++ b/src/Virt_ComputerSystemMigrationIndication.c Thu Feb 07 16:38:44 2008 -0500
@@ -58,7 +58,13 @@ static CMPIStatus ActivateFilter(CMPIInd
CMPIBoolean first)
{
CMPIStatus s = {CMPI_RC_OK, NULL};
+ struct std_indication_ctx *_ctx;
+ _ctx = (struct std_indication_ctx *)mi->hdl;
+ s = stdi_set_ind_state_prop(_ctx,
+ "Xen_ComputerSystemMigrationIndication",
+ STDI_PROP_FILTER,
+ true);
return s;
}
@@ -69,16 +75,31 @@ static CMPIStatus DeActivateFilter(CMPII
const CMPIObjectPath* op,
CMPIBoolean last)
{
- return (CMPIStatus){CMPI_RC_OK, NULL};
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+ struct std_indication_ctx *_ctx;
+
+ _ctx = (struct std_indication_ctx *)mi->hdl;
+ s = stdi_set_ind_state_prop(_ctx,
+ "Xen_ComputerSystemMigrationIndication",
+ STDI_PROP_FILTER,
+ true);
+ return s;
}
static _EI_RTYPE EnableIndications(CMPIIndicationMI* mi,
const CMPIContext *ctx)
{
+ CMPIStatus s = {CMPI_RC_OK, NULL};
struct std_indication_ctx *_ctx;
_ctx = (struct std_indication_ctx *)mi->hdl;
- _ctx->enabled = true;
- CU_DEBUG("ComputerSystemModifiedIndication enabled");
+
+ CU_DEBUG("New enable. Cross your fingers");
+ s = stdi_set_ind_state_prop(_ctx,
+ "Xen_ComputerSystemMigrationIndication",
+ STDI_PROP_ENABLE,
+ true);
+
+ CU_DEBUG("ComputerSystemMigrationIndication enabled");
_EI_RET();
}
@@ -86,10 +107,16 @@ static _EI_RTYPE DisableIndications(CMPI
static _EI_RTYPE DisableIndications(CMPIIndicationMI* mi,
const CMPIContext *ctx)
{
+ CMPIStatus s = {CMPI_RC_OK, NULL};
struct std_indication_ctx *_ctx;
_ctx = (struct std_indication_ctx *)mi->hdl;
- _ctx->enabled = false;
- CU_DEBUG("ComputerSystemModifiedIndication disabled");
+
+ s = stdi_set_ind_state_prop(_ctx,
+ "Xen_ComputerSystemMigrationIndication",
+ STDI_PROP_ENABLE,
+ false);
+
+ CU_DEBUG("ComputerSystemMigrationIndication disabled");
_EI_RET();
}
@@ -97,6 +124,17 @@ static struct std_indication_handler csi
static struct std_indication_handler csi = {
.raise_fn = NULL,
.trigger_fn = NULL,
+};
+
+static struct std_ind_state migrate = {
+ .ind_name = "Xen_ComputerSystemMigrationIndication",
+ .filter_active = false,
+ .enabled = false,
+};
+
+static struct std_ind_state *states[] = {
+ &migrate,
+ NULL,
};
DEFAULT_IND_CLEANUP();
@@ -107,7 +145,8 @@ STDI_IndicationMIStub(,
Virt_ComputerSystemMigrationIndication,
_BROKER,
libvirt_cim_init(),
- &csi);
+ &csi,
+ states);
/*
* Local Variables: