diff options
author | Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> | 2022-03-15 00:20:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-15 00:20:54 +0300 |
commit | ed2aceab6ee059a40d939ea21364bc18ec80d94b (patch) | |
tree | 654bbae1b29b9dcdc6e4ed0036dc5d70ad0544a5 /src/state/deactivating_state.hpp | |
parent | 1fb7beae5e97aadf8471ae7b6e07f5c2e5f33c78 (diff) | |
download | virtual-media-ed2aceab6ee059a40d939ea21364bc18ec80d94b.tar.xz |
Make mount/unmount dbus calls asynchronous
Change the default behavior of mount/umount dbus calls from blocking to
unblocking ones.
Once mount/unmount is triggered, appropriate action is running in the
background moving handling of operation result to async event. At the
end of processing dbus completion signal is sent to client with uint
value of operation status (identical with errno code).
Tested:
Manual scheduling of mount and unmount operations with monitoring dbus
communication of virtual-media service - matching api calls with
completion signal.
Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Diffstat (limited to 'src/state/deactivating_state.hpp')
-rw-r--r-- | src/state/deactivating_state.hpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/state/deactivating_state.hpp b/src/state/deactivating_state.hpp index 57f1072..472b6f1 100644 --- a/src/state/deactivating_state.hpp +++ b/src/state/deactivating_state.hpp @@ -64,14 +64,17 @@ struct DeactivatingState : public BasicStateT<DeactivatingState> { LogMsg(Logger::Info, machine.getName(), " udev StateChange::removed"); + return std::make_unique<ReadyState>(machine); } else { LogMsg(Logger::Error, machine.getName(), " udev StateChange::", static_cast<std::underlying_type_t<StateChange>>( udevStateChangeEvent->devState)); + return std::make_unique<ReadyState>( + machine, std::errc::connection_refused, + "Not expected udev state"); } - return std::make_unique<ReadyState>(machine); } return nullptr; } |