summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chassishandler.cpp12
-rw-r--r--dcmihandler.cpp14
-rw-r--r--include/ipmid/types.hpp6
-rw-r--r--selutility.cpp4
-rw-r--r--selutility.hpp4
-rw-r--r--sensordatahandler.hpp4
-rw-r--r--settings.cpp2
-rw-r--r--storagehandler.cpp6
-rw-r--r--user_channel/channel_mgmt.hpp4
-rw-r--r--user_channel/user_mgmt.cpp4
-rw-r--r--user_channel/user_mgmt.hpp3
11 files changed, 31 insertions, 32 deletions
diff --git a/chassishandler.cpp b/chassishandler.cpp
index a9e188f..541ab52 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -1139,7 +1139,7 @@ void enclosureIdentifyLed(bool flag)
dbus.new_method_call(connection.c_str(), identify_led_object_name,
"org.freedesktop.DBus.Properties", "Set");
led.append("xyz.openbmc_project.Led.Group", "Asserted",
- sdbusplus::message::variant<bool>(flag));
+ std::variant<bool>(flag));
auto ledReply = dbus.call(led);
if (ledReply.is_method_error())
{
@@ -1251,8 +1251,7 @@ static ipmi_ret_t setBootSource(const Source::Sources& source)
{
using namespace chassis::internal;
using namespace chassis::internal::cache;
- sdbusplus::message::variant<std::string> property =
- convertForMessage(source);
+ std::variant<std::string> property = convertForMessage(source);
auto bootSetting = settings::boot::setting(objects, bootSourceIntf);
const auto& bootSourceSetting = std::get<settings::Path>(bootSetting);
auto method = dbus.new_method_call(
@@ -1277,7 +1276,7 @@ static ipmi_ret_t setBootMode(const Mode::Modes& mode)
{
using namespace chassis::internal;
using namespace chassis::internal::cache;
- sdbusplus::message::variant<std::string> property = convertForMessage(mode);
+ std::variant<std::string> property = convertForMessage(mode);
auto bootSetting = settings::boot::setting(objects, bootModeIntf);
const auto& bootModeSetting = std::get<settings::Path>(bootSetting);
auto method = dbus.new_method_call(
@@ -1344,7 +1343,7 @@ ipmi_ret_t ipmi_chassis_get_sys_boot_options(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
*data_len = 0;
return IPMI_CC_UNSPECIFIED_ERROR;
}
- sdbusplus::message::variant<std::string> result;
+ std::variant<std::string> result;
reply.read(result);
auto bootSource =
Source::convertSourcesFromString(std::get<std::string>(result));
@@ -1644,8 +1643,7 @@ ipmi_ret_t ipmi_chassis_set_power_restore_policy(
chassis::internal::cache::objects.map
.at(chassis::internal::powerRestoreIntf)
.front();
- sdbusplus::message::variant<std::string> property =
- convertForMessage(value);
+ std::variant<std::string> property = convertForMessage(value);
auto method = chassis::internal::dbus.new_method_call(
chassis::internal::cache::objects
diff --git a/dcmihandler.cpp b/dcmihandler.cpp
index de3d92b..f8498f5 100644
--- a/dcmihandler.cpp
+++ b/dcmihandler.cpp
@@ -13,7 +13,7 @@
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
#include <sdbusplus/bus.hpp>
-#include <sdbusplus/message/types.hpp>
+#include <variant>
#include <xyz/openbmc_project/Common/error.hpp>
using namespace phosphor::logging;
@@ -85,7 +85,7 @@ uint32_t getPcap(sdbusplus::bus::bus& bus)
log<level::ERR>("Error in getPcap prop");
elog<InternalFailure>();
}
- sdbusplus::message::variant<uint32_t> pcap;
+ std::variant<uint32_t> pcap;
reply.read(pcap);
return std::get<uint32_t>(pcap);
@@ -106,7 +106,7 @@ bool getPcapEnabled(sdbusplus::bus::bus& bus)
log<level::ERR>("Error in getPcapEnabled prop");
elog<InternalFailure>();
}
- sdbusplus::message::variant<bool> pcapEnabled;
+ std::variant<bool> pcapEnabled;
reply.read(pcapEnabled);
return std::get<bool>(pcapEnabled);
@@ -120,7 +120,7 @@ void setPcap(sdbusplus::bus::bus& bus, const uint32_t powerCap)
"org.freedesktop.DBus.Properties", "Set");
method.append(PCAP_INTERFACE, POWER_CAP_PROP);
- method.append(sdbusplus::message::variant<uint32_t>(powerCap));
+ method.append(std::variant<uint32_t>(powerCap));
auto reply = bus.call(method);
@@ -139,7 +139,7 @@ void setPcapEnable(sdbusplus::bus::bus& bus, bool enabled)
"org.freedesktop.DBus.Properties", "Set");
method.append(PCAP_INTERFACE, POWER_CAP_ENABLE_PROP);
- method.append(sdbusplus::message::variant<bool>(enabled));
+ method.append(std::variant<bool>(enabled));
auto reply = bus.call(method);
@@ -205,7 +205,7 @@ std::string readAssetTag()
elog<InternalFailure>();
}
- sdbusplus::message::variant<std::string> assetTag;
+ std::variant<std::string> assetTag;
reply.read(assetTag);
return std::get<std::string>(assetTag);
@@ -225,7 +225,7 @@ void writeAssetTag(const std::string& assetTag)
(objectTree.begin()->first).c_str(), dcmi::propIntf, "Set");
method.append(dcmi::assetTagIntf);
method.append(dcmi::assetTagProp);
- method.append(sdbusplus::message::variant<std::string>(assetTag));
+ method.append(std::variant<std::string>(assetTag));
auto reply = bus.call(method);
if (reply.is_method_error())
diff --git a/include/ipmid/types.hpp b/include/ipmid/types.hpp
index 57c5873..fcc635c 100644
--- a/include/ipmid/types.hpp
+++ b/include/ipmid/types.hpp
@@ -5,6 +5,7 @@
#include <map>
#include <sdbusplus/server.hpp>
#include <string>
+#include <variant>
namespace ipmi
{
@@ -15,9 +16,8 @@ using DbusInterface = std::string;
using DbusObjectInfo = std::pair<DbusObjectPath, DbusService>;
using DbusProperty = std::string;
-using Value = sdbusplus::message::variant<bool, uint8_t, int16_t, uint16_t,
- int32_t, uint32_t, int64_t, uint64_t,
- double, std::string>;
+using Value = std::variant<bool, uint8_t, int16_t, uint16_t, int32_t, uint32_t,
+ int64_t, uint64_t, double, std::string>;
using PropertyMap = std::map<DbusProperty, Value>;
diff --git a/selutility.cpp b/selutility.cpp
index 0d71a47..615ad81 100644
--- a/selutility.cpp
+++ b/selutility.cpp
@@ -138,7 +138,7 @@ GetSELEntryResponse convertLogEntrytoSEL(const std::string& objPath)
using AssociationList =
std::vector<std::tuple<std::string, std::string, std::string>>;
- sdbusplus::message::variant<AssociationList> list;
+ std::variant<AssociationList> list;
reply.read(list);
auto& assocs = std::get<AssociationList>(list);
@@ -200,7 +200,7 @@ std::chrono::seconds getEntryTimeStamp(const std::string& objPath)
elog<InternalFailure>();
}
- sdbusplus::message::variant<uint64_t> timeStamp;
+ std::variant<uint64_t> timeStamp;
reply.read(timeStamp);
std::chrono::milliseconds chronoTimeStamp(std::get<uint64_t>(timeStamp));
diff --git a/selutility.hpp b/selutility.hpp
index b21081a..bf16a5c 100644
--- a/selutility.hpp
+++ b/selutility.hpp
@@ -28,8 +28,8 @@ using Id = uint32_t;
using Timestamp = uint64_t;
using Message = std::string;
using AdditionalData = std::vector<std::string>;
-using PropertyType = sdbusplus::message::variant<Resolved, Id, Timestamp,
- Message, AdditionalData>;
+using PropertyType =
+ std::variant<Resolved, Id, Timestamp, Message, AdditionalData>;
static constexpr auto selVersion = 0x51;
static constexpr auto invalidTimeStamp = 0xFFFFFFFF;
diff --git a/sensordatahandler.hpp b/sensordatahandler.hpp
index a7eadda..73f0dbf 100644
--- a/sensordatahandler.hpp
+++ b/sensordatahandler.hpp
@@ -250,7 +250,7 @@ ipmi_ret_t readingAssertion(const SetSensorReadingReq& cmdData,
for (const auto& property : interface->second)
{
msg.append(property.first);
- sdbusplus::message::variant<T> value =
+ std::variant<T> value =
(cmdData.assertOffset8_14 << 8) | cmdData.assertOffset0_7;
msg.append(value);
}
@@ -281,7 +281,7 @@ ipmi_ret_t readingData(const SetSensorReadingReq& cmdData,
for (const auto& property : interface->second)
{
msg.append(property.first);
- sdbusplus::message::variant<T> value = raw_value;
+ std::variant<T> value = raw_value;
msg.append(value);
}
return updateToDbus(msg);
diff --git a/settings.cpp b/settings.cpp
index a51fa95..2fa2511 100644
--- a/settings.cpp
+++ b/settings.cpp
@@ -129,7 +129,7 @@ std::tuple<Path, OneTimeEnabled> setting(const Objects& objects,
elog<InternalFailure>();
}
- sdbusplus::message::variant<bool> enabled;
+ std::variant<bool> enabled;
reply.read(enabled);
auto oneTimeEnabled = std::get<bool>(enabled);
const Path& setting = oneTimeEnabled ? oneTimeSetting : regularSetting;
diff --git a/storagehandler.cpp b/storagehandler.cpp
index 6f20835..88a0aa1 100644
--- a/storagehandler.cpp
+++ b/storagehandler.cpp
@@ -19,9 +19,9 @@
#include <ipmid/utils.hpp>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
-#include <sdbusplus/message/types.hpp>
#include <sdbusplus/server.hpp>
#include <string>
+#include <variant>
#include <xyz/openbmc_project/Common/error.hpp>
void register_netfn_storage_functions() __attribute__((constructor));
@@ -488,7 +488,7 @@ ipmi_ret_t ipmi_storage_get_sel_time(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
{
sdbusplus::bus::bus bus{ipmid_get_sd_bus_connection()};
auto service = ipmi::getService(bus, TIME_INTERFACE, HOST_TIME_PATH);
- sdbusplus::message::variant<uint64_t> value;
+ std::variant<uint64_t> value;
// Get host time
auto method = bus.new_method_call(service.c_str(), HOST_TIME_PATH,
@@ -558,7 +558,7 @@ ipmi_ret_t ipmi_storage_set_sel_time(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
{
sdbusplus::bus::bus bus{ipmid_get_sd_bus_connection()};
auto service = ipmi::getService(bus, TIME_INTERFACE, HOST_TIME_PATH);
- sdbusplus::message::variant<uint64_t> value{usec.count()};
+ std::variant<uint64_t> value{usec.count()};
// Set host time
auto method = bus.new_method_call(service.c_str(), HOST_TIME_PATH,
diff --git a/user_channel/channel_mgmt.hpp b/user_channel/channel_mgmt.hpp
index baeb8c7..b044f66 100644
--- a/user_channel/channel_mgmt.hpp
+++ b/user_channel/channel_mgmt.hpp
@@ -23,14 +23,14 @@
#include <ctime>
#include <nlohmann/json.hpp>
#include <sdbusplus/bus.hpp>
+#include <variant>
namespace ipmi
{
using Json = nlohmann::json;
-using DbusVariant =
- sdbusplus::message::variant<std::vector<std::string>, std::string, bool>;
+using DbusVariant = std::variant<std::vector<std::string>, std::string, bool>;
using DbusChObjProperties = std::vector<std::pair<std::string, DbusVariant>>;
diff --git a/user_channel/user_mgmt.cpp b/user_channel/user_mgmt.cpp
index 89ba142..41ec5fa 100644
--- a/user_channel/user_mgmt.cpp
+++ b/user_channel/user_mgmt.cpp
@@ -31,6 +31,7 @@
#include <regex>
#include <sdbusplus/bus/match.hpp>
#include <sdbusplus/server/object.hpp>
+#include <variant>
#include <xyz/openbmc_project/Common/error.hpp>
#include <xyz/openbmc_project/User/Common/error.hpp>
@@ -106,8 +107,7 @@ static std::array<std::string, (PRIVILEGE_OEM + 1)> ipmiPrivIndex = {
using namespace phosphor::logging;
using Json = nlohmann::json;
-using PrivAndGroupType =
- sdbusplus::message::variant<std::string, std::vector<std::string>>;
+using PrivAndGroupType = std::variant<std::string, std::vector<std::string>>;
using NoResource =
sdbusplus::xyz::openbmc_project::User::Common::Error::NoResource;
diff --git a/user_channel/user_mgmt.hpp b/user_channel/user_mgmt.hpp
index 857be99..8061482 100644
--- a/user_channel/user_mgmt.hpp
+++ b/user_channel/user_mgmt.hpp
@@ -23,12 +23,13 @@
#include <cstdint>
#include <ctime>
#include <sdbusplus/bus.hpp>
+#include <variant>
namespace ipmi
{
using DbusUserPropVariant =
- sdbusplus::message::variant<std::vector<std::string>, std::string, bool>;
+ std::variant<std::vector<std::string>, std::string, bool>;
using DbusUserObjPath = sdbusplus::message::object_path;
OpenPOWER on IntegriCloud