diff options
author | Karol Wachowski <karol.wachowski@intel.com> | 2020-07-23 11:25:04 +0300 |
---|---|---|
committer | Feist, James <james.feist@intel.com> | 2020-07-24 02:06:44 +0300 |
commit | 05eb73ebe684b8d2879c3802029fd783bdf6686c (patch) | |
tree | 11c842b080d838e8e05ed165785db7f0add1826a /src/state/initial_state.hpp | |
parent | 2428b6eed51e30a324148529eb6429a9d474f857 (diff) | |
download | virtual-media-05eb73ebe684b8d2879c3802029fd783bdf6686c.tar.xz |
VirtualMedia throw EBUSY exception when receive invalid event in
actiavting/deactivating states
Previously mount/unmount waited until timeout occurs, when
operation was already process it could finish before the timeout
causing mount/unmount to get false positive/negative results.
Tested: - Mount/Unmount dbus calls cause EBUSY exception in
actiavting/deactivating states
Change-Id: Idaacde212531c963aec304ac87e536d014d9d8d2
Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>
Diffstat (limited to 'src/state/initial_state.hpp')
-rw-r--r-- | src/state/initial_state.hpp | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/state/initial_state.hpp b/src/state/initial_state.hpp index fecf2b6..f64ff25 100644 --- a/src/state/initial_state.hpp +++ b/src/state/initial_state.hpp @@ -134,17 +134,7 @@ struct InitialState : public BasicStateT<InitialState> timerPeriod](boost::asio::yield_context yield) { LogMsg(Logger::Info, "[App]: Unmount called on ", machine.getName()); - - try - { - machine.emitUnmountEvent(); - } - catch (const std::exception& e) - { - LogMsg(Logger::Error, e.what()); - throw sdbusplus::exception::SdBusError(EPERM, e.what()); - return false; - } + machine.emitUnmountEvent(); auto repeats = waitCnt; boost::asio::steady_timer timer(machine.getIoc()); @@ -174,16 +164,7 @@ struct InitialState : public BasicStateT<InitialState> interfaces::MountPointStateMachine& machine, std::optional<interfaces::MountPointStateMachine::Target> target) { - try - { - machine.emitMountEvent(std::move(target)); - } - catch (const std::exception& e) - { - LogMsg(Logger::Error, e.what()); - throw sdbusplus::exception::SdBusError(EPERM, e.what()); - return false; - } + machine.emitMountEvent(std::move(target)); auto repeats = waitCnt; boost::asio::steady_timer timer(machine.getIoc()); |