blob: c0ffa012d15a6b469b1d3c293f9da839ce256584 [file] [log] [blame]
Lei YU9b21efc2019-02-21 15:52:53 +08001#pragma once
2
3#include "activation.hpp"
4
5namespace openpower
6{
7namespace software
8{
9namespace updater
10{
11
12class RedundancyPriorityUbi : public RedundancyPriority
13{
14 public:
Adriana Kobylakdf7a6152019-03-25 14:06:49 -050015 RedundancyPriorityUbi(sdbusplus::bus::bus& bus, const std::string& path,
16 Activation& parent, uint8_t value) :
17 RedundancyPriority(bus, path, parent, value)
18 {
19 priority(value);
20 }
Lei YU9b21efc2019-02-21 15:52:53 +080021 virtual ~RedundancyPriorityUbi() = default;
22
23 /** @brief Overloaded Priority property set function
24 *
25 * @param[in] value - uint8_t
26 *
27 * @return Success or exception thrown
28 */
29 uint8_t priority(uint8_t value) override;
30};
31
32/** @class ActivationUbi
33 * @brief OpenBMC activation software management implementation.
34 * @details A concrete implementation for
35 * xyz.openbmc_project.Software.Activation DBus API.
36 */
37class ActivationUbi : public Activation
38{
39 public:
40 using Activation::Activation;
41 virtual ~ActivationUbi() = default;
42
43 /** @brief Overloaded Activation property setter function
44 *
45 * @param[in] value - One of Activation::Activations
46 *
47 * @return Success or exception thrown
48 */
49 Activations activation(Activations value) override;
50
51 RequestedActivations
52 requestedActivation(RequestedActivations value) override;
53
54 private:
55 /** @brief Tracks whether the read-only & read-write volumes have been
56 *created as part of the activation process. **/
57 bool ubiVolumesCreated = false;
58
59 void unitStateChange(sdbusplus::message::message& msg) override;
60 void startActivation() override;
61 void finishActivation() override;
62};
63
64} // namespace updater
65} // namespace software
66} // namespace openpower