summaryrefslogtreecommitdiff
path: root/redfish-core/lib/virtual_media.hpp
diff options
context:
space:
mode:
authorEd Tanous <ed@tanous.net>2020-12-17 19:54:55 +0300
committerEd Tanous <ed@tanous.net>2020-12-18 23:21:35 +0300
commit81ce609e30274435b4f8c3fc65340c6b6b153b0c (patch)
treef07c0bb8f950f81adc853845e009d9d40e254468 /redfish-core/lib/virtual_media.hpp
parentf16f62633a64f386fd0382703ff0949ea177f457 (diff)
downloadbmcweb-81ce609e30274435b4f8c3fc65340c6b6b153b0c.tar.xz
Fix .clang-tidy
camelLower is not a type, camelBack is. Changes were made automatically with clang-tidy --fix-errors To be able to apply changes automatically, the only way I've found that works was to build the version of clang/clang-tidy that yocto has, and run the fix script within bitbake -c devshell bmcweb. Unfortunately, yocto has clang-tidy 11, which can apparently find a couple extra errors in tests we already had enabled. As such, a couple of those are also included. Tested: Ran clang-tidy-11 and got a clean result. Signed-off-by: Ed Tanous <ed@tanous.net> Change-Id: I9d1080b67f0342229c2f267160849445c065ca51
Diffstat (limited to 'redfish-core/lib/virtual_media.hpp')
-rw-r--r--redfish-core/lib/virtual_media.hpp44
1 files changed, 21 insertions, 23 deletions
diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp
index 6d1672c66b..95a8881ab2 100644
--- a/redfish-core/lib/virtual_media.hpp
+++ b/redfish-core/lib/virtual_media.hpp
@@ -55,7 +55,7 @@ static std::string getTransferProtocolTypeFromUri(const std::string& imageUri)
* @brief Read all known properties from VM object interfaces
*/
static void vmParseInterfaceObject(const DbusInterfaceType& interface,
- std::shared_ptr<AsyncResp> aResp)
+ const std::shared_ptr<AsyncResp>& aResp)
{
const auto mountPointIface =
interface.find("xyz.openbmc_project.VirtualMedia.MountPoint");
@@ -227,7 +227,7 @@ static void getVmResourceList(std::shared_ptr<AsyncResp> aResp,
/**
* @brief Fills data for specific resource
*/
-static void getVmData(std::shared_ptr<AsyncResp> aResp,
+static void getVmData(const std::shared_ptr<AsyncResp>& aResp,
const std::string& service, const std::string& name,
const std::string& resName)
{
@@ -334,7 +334,7 @@ class VirtualMediaActionInsertMedia : public Node
{
return TransferProtocol::smb;
}
- else if (scheme == "https")
+ if (scheme == "https")
{
return TransferProtocol::https;
}
@@ -380,7 +380,7 @@ class VirtualMediaActionInsertMedia : public Node
* @brief Function extends URI with transfer protocol type.
*
*/
- const std::string
+ std::string
getUriWithTransferProtocol(const std::string& imageUri,
const TransferProtocol& transferProtocol)
{
@@ -557,9 +557,9 @@ class VirtualMediaActionInsertMedia : public Node
BMCWEB_LOG_DEBUG << "GetObjectType: " << service;
crow::connections::systemBus->async_method_call(
- [this, service, resName, req, aResp{std::move(aResp)}](
- const boost::system::error_code ec,
- ManagedObjectType& subtree) {
+ [this, service, resName, req,
+ aResp{aResp}](const boost::system::error_code ec,
+ ManagedObjectType& subtree) {
if (ec)
{
BMCWEB_LOG_DEBUG << "DBUS response error";
@@ -635,10 +635,10 @@ class VirtualMediaActionInsertMedia : public Node
// manager is irrelevant for VirtualMedia dbus
// calls
- doMountVmLegacy(
- std::move(aResp), service, resName,
- imageUrl, !(*writeProtected),
- std::move(*userName), std::move(*password));
+ doMountVmLegacy(aResp, service, resName,
+ imageUrl, !(*writeProtected),
+ std::move(*userName),
+ std::move(*password));
return;
}
@@ -732,7 +732,7 @@ class VirtualMediaActionInsertMedia : public Node
return credentials.password();
}
- SecureBuffer pack(const FormatterFunc formatter)
+ SecureBuffer pack(FormatterFunc formatter)
{
SecureBuffer packed{new Buffer{}};
if (formatter)
@@ -770,7 +770,7 @@ class VirtualMediaActionInsertMedia : public Node
}
template <typename WriteHandler>
- void async_write(WriteHandler&& handler)
+ void asyncWrite(WriteHandler&& handler)
{
impl.async_write_some(data(), std::forward<WriteHandler>(handler));
}
@@ -803,7 +803,7 @@ class VirtualMediaActionInsertMedia : public Node
*
* All BMC state properties will be retrieved before sending reset request.
*/
- void doMountVmLegacy(std::shared_ptr<AsyncResp> asyncResp,
+ void doMountVmLegacy(const std::shared_ptr<AsyncResp>& asyncResp,
const std::string& service, const std::string& name,
const std::string& imageUrl, const bool rw,
std::string&& userName, std::string&& password)
@@ -845,7 +845,7 @@ class VirtualMediaActionInsertMedia : public Node
unixFd = secretPipe->fd();
// Pass secret over pipe
- secretPipe->async_write(
+ secretPipe->asyncWrite(
[asyncResp](const boost::system::error_code& ec, std::size_t) {
if (ec)
{
@@ -939,9 +939,9 @@ class VirtualMediaActionEjectMedia : public Node
BMCWEB_LOG_DEBUG << "GetObjectType: " << service;
crow::connections::systemBus->async_method_call(
- [this, resName, service, req, aResp{std::move(aResp)}](
- const boost::system::error_code ec,
- ManagedObjectType& subtree) {
+ [this, resName, service, req,
+ aResp{aResp}](const boost::system::error_code ec,
+ ManagedObjectType& subtree) {
if (ec)
{
BMCWEB_LOG_DEBUG << "DBUS response error";
@@ -968,16 +968,14 @@ class VirtualMediaActionEjectMedia : public Node
if (lastIndex != std::string::npos)
{
// Proxy mode
- doVmAction(std::move(aResp), service,
- resName, false);
+ doVmAction(aResp, service, resName, false);
}
lastIndex = path.rfind("Legacy");
if (lastIndex != std::string::npos)
{
// Legacy mode
- doVmAction(std::move(aResp), service,
- resName, true);
+ doVmAction(aResp, service, resName, true);
}
return;
@@ -1001,7 +999,7 @@ class VirtualMediaActionEjectMedia : public Node
*
* All BMC state properties will be retrieved before sending reset request.
*/
- void doVmAction(std::shared_ptr<AsyncResp> asyncResp,
+ void doVmAction(const std::shared_ptr<AsyncResp>& asyncResp,
const std::string& service, const std::string& name,
bool legacy)
{