diff options
author | Karol Wachowski <karol.wachowski@intel.com> | 2020-07-10 15:37:52 +0300 |
---|---|---|
committer | Wachowski, Karol <karol.wachowski@intel.com> | 2020-07-21 09:37:23 +0300 |
commit | 2fc6f721d834534e750764d753b666768b66cfe5 (patch) | |
tree | 2180aa30911ca62485244b192eebe6ffc220a557 /src/state/activating_state.cpp | |
parent | 0d65aa179dea3670b9fe46000abc705a1447ffe9 (diff) | |
download | virtual-media-2fc6f721d834534e750764d753b666768b66cfe5.tar.xz |
VirtualMedia add Mount/Unmount timeout handling
Added Timeout dbus property for block devices in VirtualMedia.
Added throwing EBUSY exception when Mount/Unmount operation times out.
Added transition from ActivatingState to DeactivatingState.
Tested: Verified that after mounting non-existing HTTPS resource
in proxy mode, VirtualMedia recovers restoring ready state
and throws EBUSY during that transition.
Verfied that resources can be mounter/unmounted in both legacy
and proxy mode.
Change-Id: I3768af13663046cc55976ad59062f8bc1d6396ba
Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>
Diffstat (limited to 'src/state/activating_state.cpp')
-rw-r--r-- | src/state/activating_state.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/state/activating_state.cpp b/src/state/activating_state.cpp index 3f852c7..bc9a30b 100644 --- a/src/state/activating_state.cpp +++ b/src/state/activating_state.cpp @@ -39,21 +39,12 @@ std::unique_ptr<BasicState> if (event.devState == StateChange::inserted) { gadget = std::make_unique<resource::Gadget>(machine, event.devState); - - if (gadget) - { - return std::make_unique<ActiveState>(machine, std::move(process), - std::move(gadget)); - } - - return std::make_unique<ReadyState>(machine, - std::errc::device_or_resource_busy, - "Unable to configure gadget"); + return std::make_unique<ActiveState>(machine, std::move(process), + std::move(gadget)); } - return std::make_unique<ReadyState>( - machine, std::errc::operation_not_supported, - "Unexpected udev event: " + static_cast<int>(event.devState)); + return std::make_unique<DeactivatingState>(machine, std::move(process), + std::move(gadget), event); } std::unique_ptr<BasicState> |