From c1dd28ebf57ee9bd9077007b52ebcaa70347f5e7 Mon Sep 17 00:00:00 2001 From: Karol Wachowski Date: Wed, 24 Jun 2020 09:12:23 +0000 Subject: Use timeout value from virtual-media.json file timeout value was always set to default instead of using configuration file. Tested: verified that timeout value set in /etc/virtual-media.json is actually used by service Signed-off-by: Karol Wachowski Change-Id: I6865f25c91d95eb273792798f6159838cfd013c5 Signed-off-by: Karol Wachowski --- src/configuration.hpp | 4 +++- src/state_machine.hpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/configuration.hpp b/src/configuration.hpp index 99dbec1..68606cc 100644 --- a/src/configuration.hpp +++ b/src/configuration.hpp @@ -39,8 +39,10 @@ class Configuration static std::vector toArgs(const MountPoint& mp) { + const auto timeout = std::to_string(mp.timeout.value_or(30)); std::vector args = { - "-t", "30", "-u", mp.unixSocket, mp.nbdDevice.to_path(), "-n"}; + "-t", timeout, "-u", mp.unixSocket, mp.nbdDevice.to_path(), + "-n"}; return args; } }; diff --git a/src/state_machine.hpp b/src/state_machine.hpp index c0f331f..e442631 100644 --- a/src/state_machine.hpp +++ b/src/state_machine.hpp @@ -1002,7 +1002,7 @@ struct MountPointStateMachine if (ret != 0) { // This shouldn't ever happen, perhaps best is to restart app - LogMsg(Logger::Critical, name, " Some serious failrue happen!"); + LogMsg(Logger::Critical, name, " Some serious failure happened!"); return false; } return true; -- cgit v1.2.3