From ed2aceab6ee059a40d939ea21364bc18ec80d94b Mon Sep 17 00:00:00 2001 From: Przemyslaw Czarnowski Date: Mon, 14 Mar 2022 22:20:54 +0100 Subject: 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 --- src/state/deactivating_state.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/state/deactivating_state.hpp') 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 { LogMsg(Logger::Info, machine.getName(), " udev StateChange::removed"); + return std::make_unique(machine); } else { LogMsg(Logger::Error, machine.getName(), " udev StateChange::", static_cast>( udevStateChangeEvent->devState)); + return std::make_unique( + machine, std::errc::connection_refused, + "Not expected udev state"); } - return std::make_unique(machine); } return nullptr; } -- cgit v1.2.3