History log of /openbmc/bmcweb/features/redfish/lib/log_services.hpp (Results 151 – 175 of 321)
Revision Date Author Comments
# a2dd60a6 14-Mar-2022 Brandon Kim <brandonkim@google.com>

log_services: Initialize Members@odata.count as 0

Currently when Members array is initialized to an empty array, the
Members@odata.count is not present. Initialize it as 0.

The bug seems to have be

log_services: Initialize Members@odata.count as 0

Currently when Members array is initialized to an empty array, the
Members@odata.count is not present. Initialize it as 0.

The bug seems to have been introduced by:
https://gerrit.openbmc-project.xyz/50224

Tested: On QEMU -
Before change:
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/Crashdump/Entries",
"@odata.type": "#LogEntryCollection.LogEntryCollection",
"Description": "Collection of Crashdump Entries",
"Members": [],
"Name": "Open BMC Crashdump Entries"
}

After change:
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/Crashdump/Entries",
"@odata.type": "#LogEntryCollection.LogEntryCollection",
"Description": "Collection of Crashdump Entries",
"Members": [],
"Members@odata.count": 0,
"Name": "Open BMC Crashdump Entries"
}
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/Crashdump/Entries",
"@odata.type": "#LogEntryCollection.LogEntryCollection",
"Description": "Collection of Crashdump Entries",
"Members": [
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/Crashdump/Entries/OnDemand",
"@odata.type": "#LogEntry.v1_7_0.LogEntry",
"AdditionalDataURI": "/redfish/v1/Systems/system/LogServices/Crashdump/Entries/OnDemand/crashdump_ondemand_1970-01-01T00:05:23Z.json",
"Created": "1970-01-01T00:05:23Z",
"DiagnosticDataType": "OEM",
"EntryType": "Oem",
"Id": "OnDemand",
"Name": "CPU Crashdump",
"OEMDiagnosticDataType": "PECICrashdump"
}
],
"Members@odata.count": 1,
"Name": "Open BMC Crashdump Entries"
}

Signed-off-by: Brandon Kim <brandonkim@google.com>
Change-Id: I5d17a8a62db23ad0da1c97113a4c6521bdec02cb

show more ...


# f7725d79 07-Mar-2022 Ed Tanous <edtanous@google.com>

Make code compile on clang again

There are a couple places we missed inline/static on our headers, and a
couple unused message entry callbacks for which their parameters were
incorrect (which clang

Make code compile on clang again

There are a couple places we missed inline/static on our headers, and a
couple unused message entry callbacks for which their parameters were
incorrect (which clang caught). Fix all of them.

Tested: Code compiles on clang. No-op changes.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I12c9c04d3b773c4991c6cd92d0cfd42b348762d6

show more ...


# 55f79e6f 25-Jan-2022 Ed Tanous <edtanous@google.com>

Enable readability checks

clang-tidy readability checks are overall a good thing, and help us to
write consistent and readable code, even if it doesn't change the
result.

All changes done by the ro

Enable readability checks

clang-tidy readability checks are overall a good thing, and help us to
write consistent and readable code, even if it doesn't change the
result.

All changes done by the robot.

Tested: Code compiles, inspection only (changes made by robot)

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Iee4a0c74a11eef9f158f0044eae675ebc518b549

show more ...


# 5f2b84ee 08-Feb-2022 Ed Tanous <edtanous@google.com>

Drop message severity

In the way we store the message registry, we store both Severity and
MessageSeverity. Severity as a field is deprecated, and in every case
in every registry both fields have t

Drop message severity

In the way we store the message registry, we store both Severity and
MessageSeverity. Severity as a field is deprecated, and in every case
in every registry both fields have the same value. We shouldn't
duplicate data in that way. This commit changes the parse_registries.py
script to stop producing the Severity field into the struct. The few
uses we have left are moved over to use MessageRegistry.

Tested:

Redfish service validator shows no errors on the
/redfish/v1/Registries tree. Other errors present that were there
previously and are unchanged.

This saves a trivial amount: about 1kB on our compressed binary size.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ibbaf533dc59eb08365d6ed309aba16b54bc40ca1

show more ...


# fffb8c1f 08-Feb-2022 Ed Tanous <edtanous@google.com>

Change message_registries namespace to registries

The message_registries namespace is overly wordy, and results in very
long defines. Doing this one minor change reduces the code by 50 lines.
This

Change message_registries namespace to registries

The message_registries namespace is overly wordy, and results in very
long defines. Doing this one minor change reduces the code by 50 lines.
This seems worthwhile.

Tested: Unit tests pass. Namespace change only.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ib1401580b3fa47596eb56cdc86e60eeeb1c2f952

show more ...


# c5a4c82a 06-Jan-2022 Jason M. Bills <jason.m.bills@intel.com>

Make the task match string more flexible

Instead of hardcoding the match string used for the task,
this allows the match string to be set depending on the
OEMDiagnosticDataType.

Tested:
Confirmed t

Make the task match string more flexible

Instead of hardcoding the match string used for the task,
this allows the match string to be set depending on the
OEMDiagnosticDataType.

Tested:
Confirmed that the TaskMonitor still correctly updates
when the collection task completes.

Change-Id: Id079ae3f387e9a39f9e0ac74e36a7095b4999ea2
Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>

show more ...


# 2b20ef6e 06-Jan-2022 Jason M. Bills <jason.m.bills@intel.com>

Clean up Crashdump log entry creation

To avoid passing references to bad memory locations, we had to
pre-build the array with empty entries so we could pass a
reference to the array index without it

Clean up Crashdump log entry creation

To avoid passing references to bad memory locations, we had to
pre-build the array with empty entries so we could pass a
reference to the array index without it changing later.

This changes so the code that fills the log entry object checks
if it's filling a single entry or an array entry and expands
the array at that time.

This simplifies filling the "Members" array in the Crashdump
entry collection and avoids sending references to an array
index.

Tested:
Confirmed that Crashdump LogEntries are correctly filled in
the "Members" array of the collection and in the individual
LogEntry.

Change-Id: I4484e248b6d72fadbaedcbb27840cd46cfe3b323
Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>

show more ...


# ace85d60 26-Oct-2021 Ed Tanous <edtanous@google.com>

Add url type safety to message registry

There are a number of places where we use message registry messages
incorrectly. This patchset attempts to fix them, and invoke some type
safety when they're

Add url type safety to message registry

There are a number of places where we use message registry messages
incorrectly. This patchset attempts to fix them, and invoke some type
safety when they're used such that they're more obvious to use.

Namely, it changes a number of the message registry methods to accept a
boost::urls::url_view for its argument instead of a const std::string&.
This forces the calling code to correctly encode a URL to use the
method, which should make it obvious that it's not for an ID, a property
name, or anything else. In the course of doing this, several places
were found to be using the first argument incorrectly.

Tested:
curl --insecure --user root:0penBmc https://192.168.7.2/redfish/v1/Chassis/foobar

Returns:
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The requested resource of type #Chassis.v1_16_0.Chassis named foobar was not found.",
"MessageArgs": [
"#Chassis.v1_16_0.Chassis",
"foobar"
],
"MessageId": "Base.1.8.1.ResourceNotFound",
"MessageSeverity": "Critical",
"Resolution": "Provide a valid resource identifier and resubmit the request."
}
],
"code": "Base.1.8.1.ResourceNotFound",
"message": "The requested resource of type #Chassis.v1_16_0.Chassis named foobar was not found."
}

Identically to previously.

Also tested with IDs that contained % encoded characters, like
foobar%10, which gave the same result.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Icbb3bce5d190a260610087c9ef35e7becc5a50c7

show more ...


# 15ed6780 14-Dec-2021 Willy Tu <wltu@google.com>

json_utils: Add support jsonRead Patch/Action

Added support for readJson for Patch and Action. The only difference is
that Patch does not allow empty json input while Action does. Action with
empty

json_utils: Add support jsonRead Patch/Action

Added support for readJson for Patch and Action. The only difference is
that Patch does not allow empty json input while Action does. Action with
empty input will use the default value based on the implementation and
return 200 OK response code.

readJsonPatch will replace the existing readJson and be used for path
requests. It will not allow empty json input and all requested
keys are required in the json input.

readJsonAction will be used for Action requests where it is possible for
all of the properties to be optional and allow empty request.
The optional properties are determined by the requested values type.

All current Action readJson are replaced with readJsonAction. It does
not change the existing behavior since it needs `std::optional`.
This will have to be updated later as we define the default behavior.

Tested:
Added unit tests and readJsonAction allows empty empty json object.

No Change to Redfish Tree.

Change-Id: Ia5e1f81695c528a20f1dc985aee19c920d8adaea
Signed-off-by: Willy Tu <wltu@google.com>

show more ...


# 4978b63f 22-Feb-2022 Jason M. Bills <jason.m.bills@intel.com>

log_services: Un-wrap some strings

This unwraps the non-D-Bus strings in log_services.hpp.

Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
Change-Id: Iaf5e435fa11909d1bf3c65e373d994d755371e

log_services: Un-wrap some strings

This unwraps the non-D-Bus strings in log_services.hpp.

Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
Change-Id: Iaf5e435fa11909d1bf3c65e373d994d755371e2f

show more ...


# 71d5d8db 25-Jan-2022 Ed Tanous <edtanous@google.com>

readability-static-accessed-through-instance

We access std::string::npos through member variables in a couple places.
Fix it.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I587f89e15806

readability-static-accessed-through-instance

We access std::string::npos through member variables in a couple places.
Fix it.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I587f89e1580661aa311dfe4e06591ab38806e241

show more ...


# e662eae8 25-Jan-2022 Ed Tanous <edtanous@google.com>

Enable readability-implicit-bool-conversion checks

These checks ensure that we're not implicitly converting ints or
pointers into bools, which makes the code easier to read.

Tested:
Ran series thro

Enable readability-implicit-bool-conversion checks

These checks ensure that we're not implicitly converting ints or
pointers into bools, which makes the code easier to read.

Tested:
Ran series through redfish service validator. No changes observed.
UUID failing in Qemu both before and after.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I1ca0be980d136bd4e5474341f4fd62f2f6bbdbae

show more ...


# e05aec50 25-Jan-2022 Ed Tanous <edtanous@google.com>

Add readability-redundant-* checks

There's a number of redundancies in our code that clang can sanitize
out. Fix the existing problems, and enable the checks.

Signed-off-by: Ed Tanous <edtanous@go

Add readability-redundant-* checks

There's a number of redundancies in our code that clang can sanitize
out. Fix the existing problems, and enable the checks.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ie63d7b7f0777b702fbf1b23a24e1bed7b4f5183b

show more ...


# 9eb808c1 25-Jan-2022 Ed Tanous <edtanous@google.com>

Enable readability-avoid-const-params-in-decls

This check involves explicitly declaring variables const when they're
declared auto, which helps in readability, and makes it more clear that
the varia

Enable readability-avoid-const-params-in-decls

This check involves explicitly declaring variables const when they're
declared auto, which helps in readability, and makes it more clear that
the variables are const.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I71198ea03850384a389a56ad26f2c4a48c75b148

show more ...


# dcf2ebc0 25-Jan-2022 Ed Tanous <edtanous@google.com>

Enable readability-redundant-control-flow checks

These checks are a nice addition to our static analysis, as they
simplify code quite a bit, as can be seen by this diff being negative
lines.

Signed

Enable readability-redundant-control-flow checks

These checks are a nice addition to our static analysis, as they
simplify code quite a bit, as can be seen by this diff being negative
lines.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I60ede4ad23d7e5337e811d70ddcab24bf8986891

show more ...


# 50b8a43a 03-Feb-2022 Ed Tanous <edtanous@google.com>

Remove NEW_BOOST_URL macro

Now that the subtree update is done, this define is no longer needed.

Tested: Code compiles. Noop.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Idc5d7ef69c

Remove NEW_BOOST_URL macro

Now that the subtree update is done, this define is no longer needed.

Tested: Code compiles. Noop.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Idc5d7ef69c009982a2476fadc1d95e3280bfff48

show more ...


# c419c759 26-Jan-2022 Ed Tanous <edtanous@google.com>

Remove getTimestamp

The aforementioned function is only used in the log services, and is
used incorrectly in that context. This commit replaces it with the
correct (and unit tested) getDateTimeUint

Remove getTimestamp

The aforementioned function is only used in the log services, and is
used incorrectly in that context. This commit replaces it with the
correct (and unit tested) getDateTimeUintMs, which is what we should be
using for dbus->time conversions in all cases, to avoid time_t
overflows when static casting.

Tested:
Before
"Created": "2022-01-31T19:39:58+00:00",
"Modified": "2022-01-31T19:39:58+00:00",

With change:
"Created": "2022-01-31T19:39:58.101000+00:00",
"Modified": "2022-01-31T19:39:58.101000+00:00",

The Redfish validator is okay with this

*** /redfish/v1/Systems/system/LogServices/EventLog/Entries/1000

Type (LogEntry.v1_8_0.LogEntry), GET SUCCESS (time: 0)
PASS

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ie8a2243230ee080d9e8785ae918fad1b1b6ab145

show more ...


# 67df073b 26-Oct-2021 Ed Tanous <edtanous@google.com>

Next round of boost-uri updates

Boost url has changed some APIs again. This commit updates our URIs to
handle it. As part of this work, it also removes some of the debug
prints that were put in ea

Next round of boost-uri updates

Boost url has changed some APIs again. This commit updates our URIs to
handle it. As part of this work, it also removes some of the debug
prints that were put in early on. These aren't really needed these
days.

This commit invents a temporary #define of NEW_BOOST_URL, so we can get
through the subtree update without a hard dependency on this specific
version of bmcweb. Ideally boost-url would have some version field, but
unfortunately, it is thusfar unversioned, as the long term intent of the
author is to be included in boost, and would be versioned there.

All the code within the else of the NEW_BOOST_URL flag will be removed
once the subtree update is landed.

Tested:
Added CXXFLAGS:append = " -DNEW_BOOST_URL" to the recipe and checked out
on top of the subtree update, and build succeeded.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ie2064e45efbc4331bdc5a5ddf44d877cde5e13cb

show more ...


# 26f6976f 25-Jan-2022 Ed Tanous <edtanous@google.com>

Enable readability-container-size-empty tests

This one is a little trivial, but it does help in readability.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I5366d4eec8af2f781b3bad804131a

Enable readability-container-size-empty tests

This one is a little trivial, but it does help in readability.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I5366d4eec8af2f781b3bad804131ae2eb806e3aa

show more ...


# 2d31491b 12-Jan-2022 Jason M. Bills <jason.m.bills@intel.com>

Simplify Crashdump file transfer

This changes to a streambuf_iterator to read the file contents
into the response body. It may be slightly slower, but it's
easier to read and has less opportunity f

Simplify Crashdump file transfer

This changes to a streambuf_iterator to read the file contents
into the response body. It may be slightly slower, but it's
easier to read and has less opportunity for errors.

Tested:
Confirmed that a Crashdump file can be successfully downloaded
through Redfish using a browser.

Change-Id: Ic143fe4274678e89330bf354d1b8098550e8b85b
Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>

show more ...


# 0dccd040 12-Jan-2022 Ed Tanous <edtanous@google.com>

Fix 32/64 bit compile issue

It turns out std::string, std::fstream::read, and std::ifstream::tellg
all use different integer types, which differ depending on 32 vs 64 bit.
This is similar to the pro

Fix 32/64 bit compile issue

It turns out std::string, std::fstream::read, and std::ifstream::tellg
all use different integer types, which differ depending on 32 vs 64 bit.
This is similar to the problem we already had, just now the compiler is
warning us. Wrap in a static_cast to make sure it builds for all
environments.

Tested: Code compiles in 32 bit.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ie8fd610812fd2271e6be599dacca583747b9217f

show more ...


# adf3d0e5 07-Jan-2022 Ed Tanous <edtanous@google.com>

Enable pro-type-static-cast-downcast checks

We only had one usage, and it was really bad and breaking const
correctness, so fix it to read the crashdump in inline.

Signed-off-by: Ed Tanous <edtanou

Enable pro-type-static-cast-downcast checks

We only had one usage, and it was really bad and breaking const
correctness, so fix it to read the crashdump in inline.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I234946fe09d73a9fa0191a15a89d0b2c26f32337

show more ...


# ca45aa3c 07-Jan-2022 Ed Tanous <edtanous@google.com>

Enable checks for pointer arithmetic

Quite a few places we've disobeyed this rule, so simply ignore them for
now to avoid new issues popping up.

Signed-off-by: Ed Tanous <edtanous@google.com>
Chang

Enable checks for pointer arithmetic

Quite a few places we've disobeyed this rule, so simply ignore them for
now to avoid new issues popping up.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I3e518a8e8742279afb3ad1a9dad54006ed109fb1

show more ...


# 46ff87ba 07-Jan-2022 Ed Tanous <edtanous@google.com>

Enable reinterpre_cast checks

We seem to use reinterpret cast in a few cases unfortunately. For the
moment, simply ignore most of them, and make it so we don't get more.

Signed-off-by: Ed Tanous <

Enable reinterpre_cast checks

We seem to use reinterpret cast in a few cases unfortunately. For the
moment, simply ignore most of them, and make it so we don't get more.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ic860cf922576b18cdc8d51d6132f5a9cbcc1d9dc

show more ...


# 914e2d5d 07-Jan-2022 Ed Tanous <edtanous@google.com>

Enforce const correctness

For all async calls, we should be consistently capturing non trivial
objects by const reference. This corrects bmcweb to be consistent and
capture errors by const value, a

Enforce const correctness

For all async calls, we should be consistently capturing non trivial
objects by const reference. This corrects bmcweb to be consistent and
capture errors by const value, and objects by const reference.

Tested: Code compiles. Trivial changes.

This saves about 300 bytes on our compressed binary size.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ib3e0b6edef9803a1c480701556949488406305d4

show more ...


12345678910>>...13