blob: e6b175ce2bf26a70675263e674b9c1c23733f87d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#pragma once
#include "configuration.hpp"
#include "resources.hpp"
#include <system_error>
struct BasicState;
namespace interfaces
{
struct MountPointStateMachine
{
struct Target
{
std::string imgUrl;
bool rw;
std::unique_ptr<resource::Mount> mountPoint;
std::unique_ptr<utils::CredentialsProvider> credentials;
};
virtual ~MountPointStateMachine() = default;
virtual void notify(const std::error_code& ec = {}) = 0;
virtual void notificationStart() = 0;
virtual void
notificationInitialize(std::shared_ptr<sdbusplus::asio::connection> con,
const std::string& svc, const std::string& iface,
const std::string& name) = 0;
virtual std::string_view getName() const = 0;
virtual Configuration::MountPoint& getConfig() = 0;
virtual std::optional<Target>& getTarget() = 0;
virtual BasicState& getState() = 0;
virtual int& getExitCode() = 0;
virtual boost::asio::io_context& getIoc() = 0;
virtual void emitRegisterDBusEvent(
std::shared_ptr<sdbusplus::asio::connection> bus,
std::shared_ptr<sdbusplus::asio::object_server> objServer) = 0;
virtual void emitMountEvent(std::optional<Target>) = 0;
virtual void emitUnmountEvent() = 0;
virtual void emitSubprocessStoppedEvent() = 0;
virtual void emitUdevStateChangeEvent(const NBDDevice& dev,
StateChange devState) = 0;
};
} // namespace interfaces
|