History log of /openbmc/bmcweb/features/redfish/include/utils/query_param.hpp (Results 26 – 50 of 60)
Revision Date Author Comments
# 62598e31 17-Jul-2023 Ed Tanous <ed@tanous.net>

Replace logging with std::format

std::format is a much more modern logging solution, and gives us a lot
more flexibility, and better compile times when doing logging.

Unfortunately, given its level

Replace logging with std::format

std::format is a much more modern logging solution, and gives us a lot
more flexibility, and better compile times when doing logging.

Unfortunately, given its level of compile time checks, it needs to be a
method, instead of the stream style logging we had before. This
requires a pretty substantial change. Fortunately, this change can be
largely automated, via the script included in this commit under
scripts/replace_logs.py. This is to aid people in moving their
patchsets over to the new form in the short period where old patches
will be based on the old logging. The intention is that this script
eventually goes away.

The old style logging (stream based) looked like.

BMCWEB_LOG_DEBUG << "Foo " << foo;

The new equivalent of the above would be:
BMCWEB_LOG_DEBUG("Foo {}", foo);

In the course of doing this, this also cleans up several ignored linter
errors, including macro usage, and array to pointer deconstruction.

Note, This patchset does remove the timestamp from the log message. In
practice, this was duplicated between journald and bmcweb, and there's
no need for both to exist.

One design decision of note is the addition of logPtr. Because the
compiler can't disambiguate between const char* and const MyThing*, it's
necessary to add an explicit cast to void*. This is identical to how
fmt handled it.

Tested: compiled with logging meson_option enabled, and launched bmcweb

Saw the usual logging, similar to what was present before:
```
[Error include/webassets.hpp:60] Unable to find or open /usr/share/www/ static file hosting disabled
[Debug include/persistent_data.hpp:133] Restored Session Timeout: 1800
[Debug redfish-core/include/event_service_manager.hpp:671] Old eventService config not exist
[Info src/webserver_main.cpp:59] Starting webserver on port 18080
[Error redfish-core/include/event_service_manager.hpp:1301] inotify_add_watch failed for redfish log file.
[Info src/webserver_main.cpp:137] Start Hostname Monitor Service...
```
Signed-off-by: Ed Tanous <ed@tanous.net>

Change-Id: I86a46aa2454be7fe80df608cb7e5573ca4029ec8

show more ...


# 37b1f7be 26-Jun-2023 Ed Tanous <edtanous@google.com>

FindNavigationReferences rename p->jsonPtr

It was pointed out in a prior review that single character variable
names were not very descriptive. Rename p to jsonPtr to be more
descriptive.

Tested:

FindNavigationReferences rename p->jsonPtr

It was pointed out in a prior review that single character variable
names were not very descriptive. Rename p to jsonPtr to be more
descriptive.

Tested: Pretty good unit test coverage here.

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

show more ...


# c59e338c 17-Jul-2022 Ed Tanous <edtanous@google.com>

Make findNavigationReference* use references

Using pointers here would require to check for null in every handler,
which is a bit wasteful. Use a reference instead.

Tested: Unit tests pass. Prett

Make findNavigationReference* use references

Using pointers here would require to check for null in every handler,
which is a bit wasteful. Use a reference instead.

Tested: Unit tests pass. Pretty good coverage for this section of code.

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

show more ...


# 87788abf 17-Jul-2022 Ed Tanous <edtanous@google.com>

Split up findNavigationReference

findNavigationReference handles a couple different types. Split it up
into the relevant types.

Tested: Unit tests pass. Pretty good coverage for this section of c

Split up findNavigationReference

findNavigationReference handles a couple different types. Split it up
into the relevant types.

Tested: Unit tests pass. Pretty good coverage for this section of code.

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

show more ...


# 32cdb4a7 23-May-2023 Willy Tu <wltu@google.com>

query: Fix default expand level with delegated

With delegate expand, the default expand level is -=
`queryCapabilities.canDelegateExpandLevel`. This creates an overlap of
expand process between dele

query: Fix default expand level with delegated

With delegate expand, the default expand level is -=
`queryCapabilities.canDelegateExpandLevel`. This creates an overlap of
expand process between delegate expand vs. default expand.

With
query.expandLevel = 2 ->
query.expandLevel = 1 and delegated.expandLevel = 1.

Both delegated and default expand will try to only expand of level one
instead of level 2 for the default.

The code in
https://github.com/openbmc/bmcweb/blob/479e899d5f57a67647f83b7f615d2c8565290bcf/redfish-core/include/utils/query_param.hpp#L583-L597
stated that the level with "@odata.id" + other property is treated as a
seperate level. So with `query.expandLevel = 1` it just loop through the
id that was already expanded and is noop.

Tested:

Before:
/redfish/v1/Chassis/BMC/Sensors?$expand=.($levels=2) returns
the same result as level=1. Needs level=3 to expand to the next level.

The RelatedItem in here doesn't get expanded with level=2.
```
wget -qO- 'http://localhost:80/redfish/v1/Chassis/BMC/Sensors?$expand=.($levels=1)'
...
{
"@odata.id": "/redfish/v1/Chassis/BMC/Sensors/temperature_DIMMXX",
"@odata.type": "#Sensor.v1_2_0.Sensor",
"Id": "temperature_DIMMXX",
"Name": "DIMMXX",
"Reading": 30.0,
"ReadingRangeMax": 127.0,
"ReadingRangeMin": -128.0,
"ReadingType": "Temperature",
"ReadingUnits": "Cel",
"RelatedItem": [
{
"@odata.id": "/redfish/v1/Systems/system/Memory/dimmXX"
}
],
"Status": {
"Health": "OK",
"State": "Enabled"
},
"Thresholds": {
"LowerCaution": {
"Reading": null
},
"LowerCritical": {
"Reading": null
},
"UpperCaution": {
"Reading": 93.0
},
"UpperCritical": {
"Reading": 95.0
}
}
}
],
"Members@odata.count": 242,
"Name": "Sensors"
}
```

After:
level=2 was able to expand to the next level.

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

show more ...


# 65a176cd 12-May-2023 Patrick Williams <patrick@stwcx.xyz>

fix clang-tidy warnings with unreachable returns

```
/data0/jenkins/workspace/ci-repository/openbmc/bmcweb/http/verb.hpp:51:12: error: 'return' will never be executed [clang-diagnostic-unreachable-c

fix clang-tidy warnings with unreachable returns

```
/data0/jenkins/workspace/ci-repository/openbmc/bmcweb/http/verb.hpp:51:12: error: 'return' will never be executed [clang-diagnostic-unreachable-code-return,-warnings-as-errors]
/data0/jenkins/workspace/ci-repository/openbmc/bmcweb/http/utility.hpp:99:12: error: 'return' will never be executed [clang-diagnostic-unreachable-code-return,-warnings-as-errors]
/data0/jenkins/workspace/ci-repository/openbmc/bmcweb/redfish-core/include/utils/query_param.hpp:272:13: error: 'break' will never be executed [clang-diagnostic-unreachable-code-break,-warnings-as-errors]
```

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ia74f4fb4f34875097d1ef04b26e40908cc175088

show more ...


# 2bd4ab43 11-May-2023 Patrick Williams <patrick@stwcx.xyz>

query-param: fix clang-tidy warnings

```
../redfish-core/include/utils/query_param.hpp:287:51: error: unsafe pointer arithmetic [-Werror,-Wunsafe-buffer-usage]
auto it = std::from_chars(value.da

query-param: fix clang-tidy warnings

```
../redfish-core/include/utils/query_param.hpp:287:51: error: unsafe pointer arithmetic [-Werror,-Wunsafe-buffer-usage]
auto it = std::from_chars(value.data(), value.data() + value.size(),
~~~~~~^~~~~~
../redfish-core/include/utils/query_param.hpp:307:45: error: unsafe pointer arithmetic [-Werror,-Wunsafe-buffer-usage]
std::from_chars(value.data(), value.data() + value.size(), param);
```

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ic93d3e98e0539f5c7068b93ff7e4505fdd5bbfe1

show more ...


# 89492a15 10-May-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: I75f89d2959b0f1338c20d72ad669fbdc1d720835
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# ad595fa6 07-Feb-2023 Ed Tanous <edtanous@google.com>

Only parse to the depth requested

There are cases in aggregation where an expand parameter might get
forwarded to a client. Because our previous expand algorithm assumed
that any endpoint within bm

Only parse to the depth requested

There are cases in aggregation where an expand parameter might get
forwarded to a client. Because our previous expand algorithm assumed
that any endpoint within bmcweb would only produce "depth=1" responses,
it was reasonable to assume that the pre-response could not contain
expanded content. Aggregated resources can't make that assumption.

This commit attempts to pass through depth through the request, to
ensure that we only expand the level that the user requested, and not
any level returned by the request. This is done by using the existence
of the resource identifer "@odata.id" to indicate each level in an
expanded response. This should be fine since the Redfish spec requires
that property to exist.

Added unit tests to cover aggregation scenarios. Modified existing
$expand tests to comply with the resource identifier dependency.

Tested:
New unit tests pass

Queried '/redfish/v1/Systems?$expand=.($levels=2)' on an aggregated
system whose satellite BMC supported $expand. The overall response was
correctly expanded for both resources on the aggregating BMC as well as
on the satellite BMC. Expanding the satellite resources did not require
sending multiple queries to the satellite.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I20ba60ee39bac11ffb3fe1768cec6299cf9ee13e
Signed-off-by: Carson Labrado <clabrado@google.com>

show more ...


# 50ebd4af 19-Jan-2023 Ed Tanous <edtanous@google.com>

Implement alternative to on boost::split

boost::split has a documented false-positive in clang-tidy. While
normally we'd handle this with NOLINTNEXTLINE, this doesn't appear to
work in all cases.

Implement alternative to on boost::split

boost::split has a documented false-positive in clang-tidy. While
normally we'd handle this with NOLINTNEXTLINE, this doesn't appear to
work in all cases. Unclear why, but seems to be due to some of our
lambda callback complexity.

Each of these uses is a case where we should be using a more specific
check, rather than split, but for the moment, this is the best we have.

Tested: clang-tidy passes.

[1] https://github.com/llvm/llvm-project/issues/40486

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

show more ...


# 079360ae 29-Jun-2022 Ed Tanous <edtanous@google.com>

Prepare for boost::url upgrade

The new boost URL now interops properly with std::string_view, which is
great, and cleans up a bunch of mediocre code to convert one to another.
It has also been pulle

Prepare for boost::url upgrade

The new boost URL now interops properly with std::string_view, which is
great, and cleans up a bunch of mediocre code to convert one to another.
It has also been pulled into boost-proper, so we no longer need a
boost-url dependency that's separate.

Unfortunately, boost url makes these improvements by changing
boost::string_view for boost::urls::const_string, which causes us to
have some compile errors on the missing type.

The bulk of these changes fall into a couple categories, and have to be
executed in one commit.
string() is replaced with buffer() on the url and url_view types
boost::string_view is replaced by std::string_view for many times, in
many cases removing a temporary that we had in the code previously.

Tested: Code compiles with boost 1.81.0 beta.
Redfish service validator passes.
Pretty good unit test coverage for URL-specific use cases.

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

show more ...


# 3590bd1d 12-Aug-2022 Nan Zhou <nanzhoumails@gmail.com>

query: propogate errors for expand

The existing code doesn't propogate errors of subqueries correctly.
This commit corrects the behavior, so that the final response gets all
error message of subquer

query: propogate errors for expand

The existing code doesn't propogate errors of subqueries correctly.
This commit corrects the behavior, so that the final response gets all
error message of subqueries and the "highest priority" HTTP code.

DMTF doesn't specify how expand queries handle error codes, since using
subqueries is an implementation choice that we made in this project.

What we did here follows existing behavior of this project, and follows
the error message section of the Redfish spec;
[1] https://redfish.dmtf.org/schemas/DSP0266_1.15.1.html#error-responses

As for now, this commit uses the worst HTTP code among all the error
code. See query_param.hpp, function |propogateErrorCode| for detailed
order of the errror codes.

Tested:
1. this is difficult to test, but I hijacked the code so it returns
errors in TaskServices, then I verified that "/redfish/v1?$expand=."
correctly returns 500 and the gets the error message set.
2. unit test so that when there are multiple errors, the final response
gets a generate error message.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I0c1ebdd9015f389801db9150d687027485f1203c

show more ...


# 07ffa4e8 09-Aug-2022 Nan Zhou <nanzhoumails@gmail.com>

query: make $select true by default

The most outstanding concerns for $select query have been resolved. We
added a set of restrictions: character set, property length, # of
properties, which makes t

query: make $select true by default

The most outstanding concerns for $select query have been resolved. We
added a set of restrictions: character set, property length, # of
properties, which makes this feature safe to use.

This commit takes $select out of the insecure flag, so every system can
start to use it. This decision has been made in Discord, available at

[1] https://discord.com/channels/775381525260664832/994314752102760559/1006650821569675355

Tested:
1. unit test passed
2. no new service validator failure on hardware

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I1f669cd35afcc1a65473a3ed665768e172a423bc

show more ...


# 5143f7a5 21-Jul-2022 Jiaqing Zhao <jiaqing.zhao@intel.com>

query_param: Move maxEntriesPerPage to Query struct

Putting the maxEntriesPerPage next to the top parameter makes it more
clear about its intention as Ed suggested. Here it is also renamed to
maxTop

query_param: Move maxEntriesPerPage to Query struct

Putting the maxEntriesPerPage next to the top parameter makes it more
clear about its intention as Ed suggested. Here it is also renamed to
maxTop to illustrate its relationship with top.

Tested:
Build, unit test and Redfish Service Validator passed.

Change-Id: I035eea7e33d78439685a81092a4dd9332cfc501a
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>

show more ...


# 5c9fb2d6 09-Aug-2022 Nan Zhou <nanzhoumails@gmail.com>

query: implement $select for objects array

This commit fixes one of the TODOs: make $select work on object arrays.
This is according to https://github.com/DMTF/Redfish/issues/5188, where
array index

query: implement $select for objects array

This commit fixes one of the TODOs: make $select work on object arrays.
This is according to https://github.com/DMTF/Redfish/issues/5188, where
array index doesn't count as the properity prefix.

To make sure reserved properties are selected on every node, this commit
also refactors some of the logics when inserting new properties.

Tested:
1. unit test
2. tested on hardware,
URL: /redfish/v1/Chassis/chassis/Thermal?$select=Temperatures/Name
{
"@odata.id": "/redfish/v1/Chassis/chassis/Thermal",
"@odata.type": "#Thermal.v1_4_0.Thermal",
"Temperatures": [
{
"@odata.id": "/redfish/v1/Chassis/chassis/Thermal#/Temperatures/0",
"@odata.type": "#Thermal.v1_3_0.Temperature",
"Name": "Abc"
},
{
"@odata.id": "/redfish/v1/Chassis/chassis/Thermal#/Temperatures/1",
"@odata.type": "#Thermal.v1_3_0.Temperature",
"Name": "Xyz"
}
]
}
3. no new service validator failures

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Ibfa22c0f42018cd0d482b4a19fff6dcd0cd346d1

show more ...


# 827c4902 02-Aug-2022 Nan Zhou <nanzhoumails@gmail.com>

query: $select : use trie

The previous implementation has a downside: it stores all intermediate
paths in a hashset. This increases the space complexity. This commit
implements a more efficient (bot

query: $select : use trie

The previous implementation has a downside: it stores all intermediate
paths in a hashset. This increases the space complexity. This commit
implements a more efficient (both time and space) algorithm: Trie.

The commit contructs a trie from the values of $select. Upon delegation,
it delegates the whole trie for now. When doing recursive select, now we
only need to keep the current JSON node and corresponding TrieNode.

Given the following assumption:
1. size of the JSON tree (#nodes) is N
2. length of the $select properties is M
3. average length of a single $select property is K

The previous implementation has the following complexity:
1. time: worst case O(N + M * K), when a property is like /a/a/a/a/a
2. space: O(N + M * K^2), when a property is like /a/a/a/a/a

The current implementation improves complexity to:
1. time: O(N + M * K)
2. space: O(N + M * K)

The total image (squashfs) decreases 4096 bytes. The binaray size
also decreases 4096 bytes.

Tested:
1. $select works on real hardware
2. No new service validator failures
3. Added more unit tests

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: If9f09db8c76e4e1abb6fa9b760be3816d9eb9f96

show more ...


# 13548d85 22-Jul-2022 Ed Tanous <edtanous@google.com>

Preserve headers from the root object on expand

There is a bug where, when running an expand query, headers from the
response object get dropped. These headers include OData.type, and the
newly min

Preserve headers from the root object on expand

There is a bug where, when running an expand query, headers from the
response object get dropped. These headers include OData.type, and the
newly minted Link header, as well as possible others.

This was actually noted in a TODO, although the author of the TODO,
didn't fully understand the consequences at the time, and thought there
was no functional impact.

To resolve this, this commit resolves the TODO, and allows the Response
object to be moved out, instead of having to create a new one, which
preserves all the response state. To do this, it creates a move
constructor on the Response object for this use. The move constructor
is relatively benign, with one caveat, that we might be moving while in
a completion handler (as is the most common use). So both the existing
operator= and Response() move constructor are amended to handle this
case, and simply null out the response object in the copied object,
which would be correct behavior, given that each callback handler should
only be called once per Response object.

Tested:
curl --insecure --user root:0penBmc -vvvv
https://192.168.7.2/redfish/v1\?\$expand\=\*\(\$levels\=2\)

returns the same body as previously, now with the included:
OData-Version: 4.0
Allow: Get

headers in the response.

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

show more ...


# 1d8d9a3f 02-Aug-2022 Nan Zhou <nanzhoumails@gmail.com>

query: remove unused branch of $select

The array branch is never used since we don't yet support $select in
object arrays. This commit can be merged before any other optimization:
two pointers, Trie

query: remove unused branch of $select

The array branch is never used since we don't yet support $select in
object arrays. This commit can be merged before any other optimization:
two pointers, Trie, etc.

Surprisingly, this commit doesn't save any binary size. The binary
doesn't change at all.

Tested:
1. unit test
2. tested on real hardware, $select is working as expected.
URL:
/redfish/v1/Systems/system?$select=Status
{
"@odata.id": "/redfish/v1/Systems/system",
"@odata.type": "#ComputerSystem.v1_16_0.ComputerSystem",
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
}
}

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Ia00f1e2b8d9a5787f8c6d819d2f817808364abd5

show more ...


# e155ab54 09-Jun-2022 Nan Zhou <nanzhoumails@gmail.com>

query: implement generic $select

This commits implement the generic handler for the $select query in
the Redfish Spec, section 7.3.3.

$select takes a comma separated list of properties, and only th

query: implement generic $select

This commits implement the generic handler for the $select query in
the Redfish Spec, section 7.3.3.

$select takes a comma separated list of properties, and only these
properties will be returned in the response.

As a first iteration, this commits doesn't handle $select combined with
$expand. It returns an unimplemented error in that case. I am currently
working with DMTF and getting their clarification. See this issue for
details: https://github.com/DMTF/Redfish/issues/5058.

It also leaves other TODOs in the comment of |processSelect|. Today,
$select is put behind the insecure-query flag.

Tested:
0. No $select is performed when the flag is disabled.
1. The core codes are just JSON manipulation. Tested in unit tests.
2. On hardware,
URL: /redfish/v1/Systems/system/ResetActionInfo?$expand=.&$select=Id
400 Bad Request

URL: /redfish/v1/Systems/system?$select=ProcessorSummary/Status
{
"@odata.id": "/redfish/v1/Systems/system",
"@odata.type": "#ComputerSystem.v1_16_0.ComputerSystem",
"ProcessorSummary": {
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Disabled"
}
}
}

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I5c570e3a0a37cbab160aafb8107ff8a5cc99a6c1

show more ...


# 3648c8be 25-Jul-2022 Ed Tanous <edtanous@google.com>

Query param: fix regression in top parameters

With the inclusion of ce8ea743055f1b82c60790db40aa3295e03bdf9c it looks
like we're now returning 400 error codes, with a response error of
QueryNotSuppo

Query param: fix regression in top parameters

With the inclusion of ce8ea743055f1b82c60790db40aa3295e03bdf9c it looks
like we're now returning 400 error codes, with a response error of
QueryNotSupportedOnResource for resources which don't support top and
skip (like RegistryFile). This would imply that the Query object NEEDS
a way to represent "user didn't provide us a skip/top parameter" which
arguably means this needs to go back to a std::optional<size_t>.

The error gets added from:
https://github.com/openbmc/bmcweb/blob/d5c80ad9c07b94465d8ea62d2b6f87c30cac765e/redfish-core/include/utils/query_param.hpp#L304
and appears to be a basic logic error in that now all queries assume
that the user provided top and skip, which fails for non-collections.

This commit moves that direction, changing the Query object back to
std::optional<size_t>. This has the unintended consequence of now
putting the idea of "defaults" back into the per-delegated handlers. This
seems reasonable, as arguably the defaults for each individual collection
are going to be different, and at some point we might want to take advant
age of that.

Tested:
1. Tested on Romulus QEMU. All passed.
2. Tested on s7106, Validator passed.

Signed-off-by: Ed Tanous <edtanous@google.com>
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I9f912957d130694b281c6e391602de158eaddcb3

show more ...


# d5c80ad9 10-Jul-2022 Nan Zhou <nanzhoumails@gmail.com>

test treewide: iwyu

These changes are done by running iwyu manually under clang14.

Suppressed some obvious impl or details headers. Kept the recommended
public headers.

IWYU can increase readabili

test treewide: iwyu

These changes are done by running iwyu manually under clang14.

Suppressed some obvious impl or details headers. Kept the recommended
public headers.

IWYU can increase readability, make maintenance easier, and avoid errors
in some cases. See details in
https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/WhyIWYU.md.

This commit also uses its best effort to correct obvious errors through
iwyu pragma.
See reference here:
https://github.com/include-what-you-use/include-what-you-use#how-to-correct-iwyu-mistakes

Tested: unit test passed.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I983b6f75601707cbb0f2f04546c3362ff4ba7fee

show more ...


# ce8ea743 24-Jun-2022 Jiaqing Zhao <jiaqing.zhao@intel.com>

query_param: Set default value of $top to maxEntriesPerPage

Current code initializes $top to std::numeric_limits<size_t>::max(),
when adding with a non-zero $skip value, it overflows. This patch
sol

query_param: Set default value of $top to maxEntriesPerPage

Current code initializes $top to std::numeric_limits<size_t>::max(),
when adding with a non-zero $skip value, it overflows. This patch
solves this issue by initializing it to maxEntriesPerPage.

Fixes c937d2b ("Make log services use parameter delegation").

Tested:
Verified providing only $skip in the query parameter in /redfish/v1
/Systems/system/LogServices/EventLog/Entries is properly handled.

Change-Id: Id5668cecda97a78f803941d6eb2e1aa0ba9495aa
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>

show more ...


# a926c53e 15-Jul-2022 Jiaqing Zhao <jiaqing.zhao@intel.com>

query_param: Update OutOfRange error message for $top and $skip

According to "Table 8 - Query parameters" of Redfish spec, the value of
$top can be 0. And $skip can also be 0 to support getting all

query_param: Update OutOfRange error message for $top and $skip

According to "Table 8 - Query parameters" of Redfish spec, the value of
$top can be 0. And $skip can also be 0 to support getting all members,
though it is not specified in spec. This commit updates the error
message accordingly.

Tested:
Error message change only since 0 is already supported in bmcweb.

Change-Id: I5cc3fd7d283f8ee4dfca9325615545d1446e2133
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>

show more ...


# 02cad96e 30-Jun-2022 Ed Tanous <edtanous@google.com>

Fix const correctness issues

cppcheck correctly notes that a lot of variables in the new code can be
const. Make most of them const.

Tested: WIP

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

Fix const correctness issues

cppcheck correctly notes that a lot of variables in the new code can be
const. Make most of them const.

Tested: WIP

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

show more ...


# 8a592810 04-Jun-2022 Ed Tanous <edtanous@google.com>

Fix shadowed variable issues

This patchset is the conclusion of a multi-year effort to try to fix
shadowed variable names. Variables seem to be shadowed all over, and in
most places they exist, the

Fix shadowed variable issues

This patchset is the conclusion of a multi-year effort to try to fix
shadowed variable names. Variables seem to be shadowed all over, and in
most places they exist, there's a "code smell" of things that aren't
doing what the author intended.

This commit attempts to clean up these in several ways by:
1. Renaming variables where appropriate.
2. Preferring to refer to member variables directly when operating
within a class
3. Rearranging code so that pass through variables are handled in the
calling scope, rather than passing them through.

These patterns are applied throughout the codebase, to the point where
-Wshadow can be enabled in meson.build.

Tested: Code compiles, unit tests pass. Still need to run redfish
service validator.

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

show more ...


123