diff options
author | Tomas Bzatek <tbzatek@redhat.com> | 2014-04-17 17:20:22 +0200 |
---|---|---|
committer | Tomas Bzatek <tbzatek@redhat.com> | 2014-04-18 13:07:04 +0200 |
commit | 3003b389012a6811e675c230b2496c42cad9aa10 (patch) | |
tree | ce08cb7755c28268196f6dfc4c4404c99198c48c /mof/60_LMI_Journald.mof | |
parent | a5f05e8b0ce3c232aaa56e9c5f6e78069eac131c (diff) | |
download | openlmi-providers-3003b389012a6811e675c230b2496c42cad9aa10.tar.gz openlmi-providers-3003b389012a6811e675c230b2496c42cad9aa10.tar.xz openlmi-providers-3003b389012a6811e675c230b2496c42cad9aa10.zip |
journald: Properly handle journal EOF
The logic of handling EOF is incompatible between journald API and
CIM_MessageLog model we use. The CIM_MessageLog.GetRecord() method
allows stepping to the next record after data retrieval but there's
no specific return code for the EOF case. And returning failure code
makes the client application think the whole data retrieval has failed
and thus throwing away the last record.
To work around this case, a new flag has been introduced to the
IterationIdentifier string, which is considered opaque to the client.
That way we return success from the GetRecord() method call and putting
a flag to the IterationIdentifier string so that any successive GetRecord()
method call properly fails without any data loss. Care is taken of the
case when a new message is logged between the GetRecord() calls.
This commit also adds the CIM_MessageLog.PositionToLastRecord() method
for convenient access to the end of the journal.
Diffstat (limited to 'mof/60_LMI_Journald.mof')
-rw-r--r-- | mof/60_LMI_Journald.mof | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mof/60_LMI_Journald.mof b/mof/60_LMI_Journald.mof index 9f59581..22f726a 100644 --- a/mof/60_LMI_Journald.mof +++ b/mof/60_LMI_Journald.mof @@ -63,6 +63,24 @@ class LMI_JournalMessageLog: CIM_MessageLog [ Implemented(true), Description ( + "Requests that an iteration of the MessageLog be " + "established and that the iterator be set to the last " + "entry in the Log. An identifier for the iterator is " + "returned as an output parameter of the method. \n" + "\n" + "The return value from PositionToFirstRecord is 0 " + "if the request was successfully executed, 1 if the " + "request is not supported and some other value if an " + "error occurred." ), + ValueMap { "0", "1", "2" }, + Values { "Success", "Not supported", "Failed" } ] + uint32 PositionToLastRecord( + [IN ( false ), OUT, Description ( + "An identifier for the iterator." )] + string IterationIdentifier); + + + [ Implemented(true), Description ( "Requests that the Log\'s iteration identifier be " "advanced or retreated a specific number of records, or " "set to the entry at a specified numeric location. These " |