summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Platash <anna.platash@intel.com>2020-10-30 12:22:45 +0300
committerAnna Platash <anna.platash@intel.com>2020-11-06 14:28:20 +0300
commit3e3995d5e0cf4a15ddce3f17a3dcc1376c1f91c2 (patch)
tree903a31fc29aa8a4920a62dbc7066360e68a8998a
parent91676334dd7d621651016b18a7fc51a1ea785731 (diff)
downloadvirtual-media-3e3995d5e0cf4a15ddce3f17a3dcc1376c1f91c2.tar.xz
Virtual Media does not propagate information
between Redfish and Web UI WriteProtected field was not updated in bmcweb. Added new property WriteProtected to MountPoint interface to allow bmcweb updating the WriteProtected field value properly. Tested on manually on ArcherCity by mounting images via RedFish interface with and without write protection. Change-Id: I9f642ace2462c52bf964d2e54b0f59fac1b06738 Signed-off-by: Anna Platash <anna.platash@intel.com>
-rw-r--r--src/state/initial_state.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/state/initial_state.hpp b/src/state/initial_state.hpp
index 3a2346c..6f20bb4 100644
--- a/src/state/initial_state.hpp
+++ b/src/state/initial_state.hpp
@@ -105,6 +105,16 @@ struct InitialState : public BasicStateT<InitialState>
return std::string();
});
iface->register_property(
+ "WriteProtected", bool(true),
+ [](const bool& req, bool& property) { return 0; },
+ [&target = machine.getTarget()](const bool& property) {
+ if (target)
+ {
+ return target->rw;
+ }
+ return bool(true);
+ });
+ iface->register_property(
"Timeout", machine.getConfig().timeout.value_or(
Configuration::MountPoint::defaultTimeout));
iface->register_property(