Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions config/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,20 @@ else
work_dir = '/home/root'
endif

multi_comp = get_option('experimental-redfish-multi-computer-system').enabled()
cpuLog = get_option('redfish-cpu-log').disable_if(
multi_comp,
error_message: 'not supported with experimental-redfish-multi-computer-system option enabled',
)
dumpLog = get_option('redfish-dump-log').disable_if(
multi_comp,
error_message: 'not supported with experimental-redfish-multi-computer-system option enabled',
)
hostLog = get_option('redfish-host-logger').disable_if(
multi_comp,
error_message: 'not supported with experimental-redfish-multi-computer-system option enabled',
)

configure_file(
input: 'bmcweb.service.in',
output: 'bmcweb.service',
Expand Down
3 changes: 3 additions & 0 deletions docs/Redfish.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ Fields common to all schemas
#### Sensor

- Implementation
- PeakReading
- PeakReadingTime
- Reading
- ReadingBasis
- ReadingRangeMax
Expand Down Expand Up @@ -476,6 +478,7 @@ Fields common to all schemas

###### Assembly

- LocationIndicatorActive
- Model
- PartNumber
- SerialNumber
Expand Down
12 changes: 0 additions & 12 deletions include/boost_formatters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,4 @@ struct std::formatter<UrlBase>
}
};

template <std::derived_from<boost::core::string_view> StringView>
struct std::formatter<StringView>
{
constexpr auto parse(std::format_parse_context& ctx)
{
return ctx.begin();
}
auto format(const StringView& msg, auto& ctx) const
{
return std::format_to(ctx.out(), "{}", std::string_view(msg));
}
};
// NOLINTEND(readability-convert-member-functions-to-static, cert-dcl58-cpp)
1 change: 1 addition & 0 deletions include/dbus_utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ using DbusVariantType = std::variant<
std::vector<uint16_t>,
sdbusplus::message::object_path,
std::tuple<uint64_t, std::vector<std::tuple<std::string, double, uint64_t>>>,
std::tuple<uint64_t, std::vector<std::tuple<std::string, std::string, double, uint64_t>>>,
std::vector<sdbusplus::message::object_path>,
std::vector<std::tuple<std::string, std::string>>,
std::vector<std::tuple<uint32_t, std::vector<uint32_t>>>,
Expand Down
21 changes: 5 additions & 16 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ incdir = [
]

# Add compiler arguments
boost_flags = ['-Wno-unused-parameter']
boost_flags = ['-Wno-pedantic']
nghttp2_flags = []
if (cxx.get_id() == 'clang')
if (cxx.version().version_compare('<17.0'))
Expand Down Expand Up @@ -291,25 +291,13 @@ bmcweb_dependencies += nlohmann_json_dep

boost = dependency(
'boost',
modules: ['url'],
version: '>=1.84.0',
required: false,
modules: ['url', 'process'],
version: '>=1.88.0',
static: true,
required: false,
include_type: 'system',
)

# Boost version is 1.86 or higher to include the 'process' module
if boost.version().version_compare('>=1.86.0')
boost = dependency(
'boost',
modules: ['url', 'process'],
version: '>=1.86.0',
static: true,
required: false,
include_type: 'system',
)
endif

if boost.found()
bmcweb_dependencies += [boost]
else
Expand All @@ -333,6 +321,7 @@ else
'CMAKE_C_FLAGS': ' '.join(boost_flags),
'BOOST_INCLUDE_LIBRARIES': ';'.join(boost_libs),
'BUILD_SHARED_LIBS': 'OFF',
'BOOST_PROCESS_USE_STD_FS': 'ON',
},
)

Expand Down
1 change: 0 additions & 1 deletion redfish-core/include/event_matches_filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include <algorithm>
#include <format>
#include <ranges>
#include <string>
#include <string_view>
#include <vector>
Expand Down
2 changes: 0 additions & 2 deletions redfish-core/include/event_service_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "utils/time_utils.hpp"

#include <boost/circular_buffer.hpp>
#include <boost/circular_buffer/base.hpp>
#include <boost/container/flat_map.hpp>
#include <boost/system/result.hpp>
#include <boost/url/parse.hpp>
Expand All @@ -30,7 +29,6 @@
#include <cstdint>
#include <cstdlib>
#include <ctime>
#include <format>
#include <memory>
#include <optional>
#include <random>
Expand Down
60 changes: 60 additions & 0 deletions redfish-core/include/utils/fan_utils.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright OpenBMC Authors
#pragma once

#include "async_resp.hpp"
#include "dbus_utility.hpp"
#include "error_messages.hpp"
#include "logging.hpp"

#include <asm-generic/errno.h>

#include <boost/system/error_code.hpp>
#include <sdbusplus/message/native_types.hpp>

#include <array>
#include <functional>
#include <memory>
#include <string>
#include <string_view>

namespace redfish
{
constexpr std::array<std::string_view, 1> fanInterface = {
"xyz.openbmc_project.Inventory.Item.Fan"};

namespace fan_utils
{
inline void getFanPaths(
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& validChassisPath,
const std::function<void(const dbus::utility::MapperGetSubTreePathsResponse&
fanPaths)>& callback)
{
sdbusplus::message::object_path endpointPath{validChassisPath};
endpointPath /= "cooled_by";

dbus::utility::getAssociatedSubTreePaths(
endpointPath,
sdbusplus::message::object_path("/xyz/openbmc_project/inventory"), 0,
fanInterface,
[asyncResp, callback](
const boost::system::error_code& ec,
const dbus::utility::MapperGetSubTreePathsResponse& subtreePaths) {
if (ec)
{
if (ec.value() != EBADR)
{
BMCWEB_LOG_ERROR(
"DBUS response error for getAssociatedSubTreePaths {}",
ec.value());
messages::internalError(asyncResp->res);
}
return;
}
callback(subtreePaths);
});
}

} // namespace fan_utils
} // namespace redfish
10 changes: 9 additions & 1 deletion redfish-core/include/utils/redfish_aggregator_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ inline crow::Request createNewRequest(const crow::Request& localReq)
BMCWEB_LOG_ERROR("Failed to set body. Continuing");
}

for (const auto& field : req.fields())
// Preserve method and target (URI) from the original request
req.method(localReq.method());
if (!req.target(localReq.target()))
{
BMCWEB_LOG_ERROR("Failed to set target on aggregated request");
}

for (const auto& field : localReq.fields())
{
// Drop any incoming x-auth-token headers and keep Host and
// Content-Type. Set Accept.
Expand All @@ -34,6 +41,7 @@ inline crow::Request createNewRequest(const crow::Request& localReq)
req.addHeader(headerName, field.value());
}
}
// Set Accept header to application/json, application/octet-stream
req.addHeader(boost::beast::http::field::accept,
"application/json, application/octet-stream");
return req;
Expand Down
Loading