<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://reviewboard-openlmi.rhcloud.com/r/351/">http://reviewboard-openlmi.rhcloud.com/r/351/</a>
</td>
</tr>
</table>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="http://reviewboard-openlmi.rhcloud.com/r/351/diff/2/?file=2297#file2297line60" style="color: black; font-weight: bold; text-decoration: underline;">src/indmanager/ind_manager.h</a>
<span style="font-weight: normal;">
(Diff revision 2)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">60</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm"> * IMEventSpawner</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">61</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm"> * This is supposed to be blocking function. Returning the true will inform</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">62</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm"> * the indication manager that the event has occured. You can set data for</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">63</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm"> * further processing in IMInstGather.</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I see now, the function does not actually spawn anything, it just waits for an event. The name confused me a bit. I leave it to you judgement if you rename it or not.
Anyway, I'd appreciate some more introduction, like:
- the ind. manager works in two modes (polling/with IMInstGather callback)
- the ind. manager can serve watch multiple classes simultaneously, but they must share the callbacks (?)
- some real-life example would be nice.
This does not need to be documented in the code, it can be in README or Usage.txt.</pre>
</div>
<br />
<p>- Jan</p>
<br />
<p>On May 16th, 2013, 1:59 p.m. CEST, Roman Rakus wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://reviewboard-openlmi.rhcloud.com/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for OpenLMI Developers.</div>
<div>By Roman Rakus.</div>
<p style="color: grey;"><i>Updated May 16, 2013, 1:59 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
openlmi-providers
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Indication manager
Signed-off-by: Roman Rakus <rrakus@redhat.com>
</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">For testing purposes I used the following provider:
#include <konkret/konkret.h>
#include "LMI_AccountInstCreationIndication.h"
#include "ind_manager.h"
#include <stdbool.h>
static const CMPIBroker* _cb = NULL;
static IMManager *im = NULL;
IMError im_err = IM_ERR_OK;
static bool filter_checker(const CMPISelectExp *filter)
{
//TODO - true checking
return true;
}
// TODO - remove !
#include <unistd.h>
static bool spawner(void *data)
{
//TODO - true checking
return true;
}
// TODO - remove !
#include <unistd.h>
static bool spawner(void *data)
{
//TODO - inotify
sleep(10);
return true;
}
static void LMI_AccountInstCreationIndicationInitialize()
{
// startup indication manager
im = im_create_manager(NULL, filter_checker, true, spawner,
IM_IND_CREATION, (CMPIBroker *)_cb, &im_err);
}
static CMPIStatus LMI_AccountInstCreationIndicationIndicationCleanup(
CMPIIndicationMI* mi,
const CMPIContext* cc,
CMPIBoolean term)
{
// destroy indication manager
im_destroy_manager(im, cc, &im_err);
CMReturn(CMPI_RC_OK);
}
static CMPIStatus LMI_AccountInstCreationIndicationAuthorizeFilter(
CMPIIndicationMI* mi,
const CMPIContext* cc,
const CMPISelectExp* se,
const char* ns,
const CMPIObjectPath* op,
const char* user)
{
// verify filter
im_verify_filter(im, se, cc, &im_err);
CMReturn(CMPI_RC_OK);
}
static CMPIStatus LMI_AccountInstCreationIndicationMustPoll(
CMPIIndicationMI* mi,
const CMPIContext* cc,
const CMPISelectExp* se,
const char* ns,
const CMPIObjectPath* op)
{
// yes, this is not supported :(
CMReturn(CMPI_RC_ERR_NOT_SUPPORTED);
}
static CMPIStatus LMI_AccountInstCreationIndicationActivateFilter(
CMPIIndicationMI* mi,
const CMPIContext* cc,
const CMPISelectExp* se,
const char* ns,
const CMPIObjectPath* op,
CMPIBoolean firstActivation)
{
// verify filter and add it via indication manager
im_verify_filter(im, se, cc, &im_err);
im_add_filter(im, (CMPISelectExp*)se, cc, &im_err);
CMReturn(CMPI_RC_OK);
}
static CMPIStatus LMI_AccountInstCreationIndicationDeActivateFilter(
CMPIIndicationMI* mi,
const CMPIContext* cc,
const CMPISelectExp* se,
const char* ns,
const CMPIObjectPath* op,
CMPIBoolean lastActivation)
{
// remove filter from indication manager
im_remove_filter(im, se, cc, &im_err);
CMReturn(CMPI_RC_OK);
}
static CMPIStatus LMI_AccountInstCreationIndicationEnableIndications(
CMPIIndicationMI* mi,
const CMPIContext* cc)
{
// start indications
im_start_ind(im, cc, &im_err);
CMReturn(CMPI_RC_OK);
}
static CMPIStatus LMI_AccountInstCreationIndicationDisableIndications(
CMPIIndicationMI* mi,
const CMPIContext* cc)
{
// stop indications
im_stop_ind(im, cc, &im_err);
CMReturn(CMPI_RC_OK);
}
CMIndicationMIStub(
LMI_AccountInstCreationIndication,
LMI_AccountInstCreationIndication,
_cb,
LMI_AccountInstCreationIndicationInitialize())
KONKRET_REGISTRATION(
"root/cimv2",
"LMI_AccountInstCreationIndication",
"LMI_AccountInstCreationIndication",
"indication")
</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>CMakeLists.txt <span style="color: grey">(f25850e1640f52aed9f18c3bd343d41f7f5f21a4)</span></li>
<li>src/CMakeLists.txt <span style="color: grey">(9f714d080d8541c368dedc235996e7a790930fff)</span></li>
<li>src/indmanager/CMakeLists.txt <span style="color: grey">(PRE-CREATION)</span></li>
<li>src/indmanager/ind_manager.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>src/indmanager/ind_manager.c <span style="color: grey">(PRE-CREATION)</span></li>
<li>src/indmanager/openlmiindmanager.pc.in <span style="color: grey">(PRE-CREATION)</span></li>
</ul>
<p><a href="http://reviewboard-openlmi.rhcloud.com/r/351/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>