Dobby RDK Storage Plugin.
More...
#include <Storage.h>
|
| Storage (std::shared_ptr< rt_dobby_schema > &containerConfig, const std::shared_ptr< DobbyRdkPluginUtils > &utils, const std::string &rootfsPath) |
| Constructor - called when plugin is loaded by PluginLauncher. More...
|
|
std::string | name () const override |
| Should return the name of the plugin. More...
|
|
unsigned | hookHints () const override |
| Set the bit flags for which hooks we're going to use.
|
|
bool | preCreation () override |
| OCI Hook - Run in host namespace.
|
|
bool | createRuntime () override |
| OCI Hook - Run in host namespace.
|
|
bool | createContainer () override |
| OCI Hook - Run in container namespace. Paths resolve to host namespace.
|
|
bool | postStart () override |
| OCI Hook - Run in container namespace. More...
|
|
bool | postStop () override |
| OCI Hook - Run in host namespace. Confusing name - is run when a container is DELETED.
|
|
std::vector< std::string > | getDependencies () const override |
| Should return the names of the plugins this plugin depends on. More...
|
|
virtual bool | postInstallation () |
|
virtual bool | postHalt () |
|
|
const std::string | mName |
|
std::shared_ptr< rt_dobby_schema > | mContainerConfig |
|
const std::string | mRootfsPath |
|
const std::shared_ptr< DobbyRdkPluginUtils > | mUtils |
|
std::string | mMountPointInsideContainer |
|
std::string | mTempMountPointOutsideContainer |
|
|
enum | HintFlags : unsigned {
PostInstallationFlag = (1 << 0)
, PreCreationFlag = (1 << 1)
, CreateRuntimeFlag = (1 << 2)
, CreateContainerFlag = (1 << 3)
,
PostStartFlag = (1 << 5)
, PostHaltFlag = (1 << 6)
, PostStopFlag = (1 << 7)
, Unknown = 0
} |
| Bit flags that should be returned by hookHints. More...
|
|
Dobby RDK Storage Plugin.
Manages loop mount devices for containers
◆ Storage()
Storage::Storage |
( |
std::shared_ptr< rt_dobby_schema > & |
containerSpec, |
|
|
const std::shared_ptr< DobbyRdkPluginUtils > & |
utils, |
|
|
const std::string & |
rootfsPath |
|
) |
| |
Constructor - called when plugin is loaded by PluginLauncher.
Do not change the parameters for this constructor - must match C methods created by REGISTER_RDK_PLUGIN macro
Note plugin name is not case sensitive
◆ getDependencies()
std::vector< std::string > Storage::getDependencies |
( |
| ) |
const |
|
overridevirtual |
Should return the names of the plugins this plugin depends on.
This can be used to determine the order in which the plugins should be processed when running hooks.
- Returns
- Names of the plugins this plugin depends on.
Reimplemented from RdkPluginBase.
◆ getDynamicMountDetails()
std::vector< std::unique_ptr< DynamicMountDetails > > Storage::getDynamicMountDetails |
( |
| ) |
const |
|
private |
Create dynamic mount details vector from all dynamic mounts in config.
- Returns
- vector of DynamicMountDetails that were in the config
◆ getDynamicMounts()
Reads container config and creates all dynamic mounts in DynamicMountProperties type objects.
- Returns
- vector of DynamicMountProperties that were in the config
◆ getLoopMountDetails()
std::vector< std::unique_ptr< LoopMountDetails > > Storage::getLoopMountDetails |
( |
| ) |
const |
|
private |
Create loop mount details vector from all loopback mounts in config.
- Returns
- vector of LoopMountDetails that were in the config
◆ getLoopMounts()
Reads container config and creates all loop mounts in LoopMountProperties type objects.
- Returns
- vector of LoopMountProperties that were in the config
◆ getMappedId()
uint32_t Storage::getMappedId |
( |
uint32_t |
id, |
|
|
rt_defs_id_mapping ** |
mapping, |
|
|
size_t |
mapping_len |
|
) |
| const |
|
private |
Gets userId or groupId based on mappings.
- Parameters
-
[in] | id | Id we want to map |
[in] | mapping | Mapping that should be used |
[in] | mapping_len | Length of mapping |
- Returns
- if found mapped id, if not found initial id
◆ getMountOwnerDetails()
std::vector< std::unique_ptr< MountOwnerDetails > > Storage::getMountOwnerDetails |
( |
| ) |
const |
|
private |
Create mount owner details vector from all mount owners in config.
- Returns
- vector of MountOwnerDetails that were in the config
◆ getMountOwners()
Reads container config to obtain source path on host, userId, groupId and recursive options. These will be used later to change ownership of the source path based on userId and groupId within the host namespace.
- Returns
- vector of MountOwnerProperties that were in the config
◆ name()
std::string Storage::name |
( |
| ) |
const |
|
inlineoverridevirtual |
Should return the name of the plugin.
- Returns
- string with the name of the hook.
Implements IDobbyRdkPlugin.
◆ postStart()
bool Storage::postStart |
( |
| ) |
|
|
overridevirtual |
OCI Hook - Run in container namespace.
OCI Hook - Run in host namespace once container has started
Reimplemented from RdkPluginBase.
◆ setupOwnerIds()
void Storage::setupOwnerIds |
( |
uid_t & |
uid, |
|
|
gid_t & |
gid |
|
) |
| const |
|
private |
Gets userId and groupId.
- Parameters
-
[in] | id | Id we want to map |
[in] | mapping | Mapping that should be used |
[in] | mapping_len | Length of mapping |
- Returns
- if found mapped id, if not found initial id
The documentation for this class was generated from the following files:
- rdkPlugins/Storage/source/Storage.h
- rdkPlugins/Storage/source/Storage.cpp