This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/837/

src/journald/LMI_JournalMessageLogProvider.c (Diff revision 1)
KUint32 LMI_JournalMessageLog_ClearLog(
213
    KUint32_Set(&result, 1);
Rather use some constant.

src/journald/LMI_JournalMessageLogProvider.c (Diff revision 1)
KUint32 LMI_JournalMessageLog_ClearLog(
229
        KUint32_Set(&result, 2);
use constant

src/journald/LMI_JournalMessageLogProvider.c (Diff revision 1)
KUint32 LMI_JournalMessageLog_ClearLog(
234
    KUint32_Set(&result, 0);
use const.

src/journald/LMI_JournalMessageLogProvider.c (Diff revision 1)
KUint32 LMI_JournalMessageLog_PositionAtRecord(
252
    gchar *iter_id;
253
    sd_journal *journal;
init to NULL

src/journald/LMI_JournalMessageLogProvider.c (Diff revision 1)
KUint32 LMI_JournalMessageLog_PositionAtRecord(
259
        KUint32_Set(&result, 2);
use const

src/journald/LMI_JournalMessageLogProvider.c (Diff revision 1)
KUint32 LMI_JournalMessageLog_PositionAtRecord(
263
    if (MoveAbsolute->value != 0) {
use const.

(not opening issues for more below)

src/journald/LMI_JournalMessageLogProvider.c (Diff revision 1)
KUint32 LMI_JournalMessageLog_PositionAtRecord(
269
    iter_id = g_strdup(IterationIdentifier->chars);
What if strdup fails?

src/journald/LMI_JournalMessageLogProvider.c (Diff revision 1)
KUint32 LMI_JournalMessageLog_GetRecord(
301
    gchar *iter_id;
302
    sd_journal *journal;
303
    char *data;
init to NULL

src/journald/instutil.c (Diff revision 1)
static int dup_journal_data(
117
    str = g_string_new(NULL);
What if new fails?

I would run coverity to check it.

- Roman Rakus


On September 6th, 2013, 3:05 p.m. UTC, Tomáš Bžatek wrote:

Review request for OpenLMI Developers.
By Tomáš Bžatek.

Updated Sept. 6, 2013, 3:05 p.m.

Repository: openlmi-providers

Description

    journald: Add support for iterators
    
    This implements CIM_MessageLog iterator functionality according to
    the model. The only limitation, or, let's say shortcoming, is a
    free-form output data format from the GetRecord call. Currently we
    feed the uint8 array with UTF-8 chars and it's up to the client to
    deal with it (as suggested in the model). This may be subject to
    change.
    
    Many methods are returning modified iterator that has been passed
    in and that allows having persistent iterators. As long as CIMOMs
    may destroy the instances and unload providers on inactivity, any
    particular delay would cause loss of the iterator. The iterator
    string contains journal cursor string, uniquely identifying a
    record. When this part of the iterator string is valid, the
    provider is able to reopen journal and seek to that position,
    allowing seamless continuation of the itearation process. If the
    cursor points to non-existing record, an error is returned. This
    typically happens when journal is rotated or the cursor is very
    old.
    
    The provider keeps track of active iterators during its lifetime,
    keeping the journal open for fast access. Clients are supposed to
    close the iterator by calling the CancelIteration method.


--
some TODOs will be addressed in future patches
tests will be published soon

Diffs

  • src/journald/LMI_JournalMessageLogProvider.c (PRE-CREATION)
  • src/journald/instutil.h (PRE-CREATION)
  • src/journald/instutil.c (PRE-CREATION)

View Diff