Class is responsible for prepare filesystem for zone It allows to create directories, files, mount points and copying files from host. More...
#include <zone-provision.hpp>
Public Member Functions | |
ZoneProvision (const std::string &rootPath, const std::string &configPath, const std::string &dbPath, const std::string &dbPrefix, const std::vector< std::string > &validLinkPrefixes) | |
ZoneProvision constructor. More... | |
~ZoneProvision () | |
ZoneProvision (const ZoneProvision &)=delete | |
ZoneProvision & | operator= (const ZoneProvision &)=delete |
ZoneProvision (ZoneProvision &&)=default | |
std::string | declareFile (const int32_t &type, const std::string &path, const int32_t &flags, const int32_t &mode) |
Declare file, directory or pipe that will be created while zone startup. More... | |
std::string | declareMount (const std::string &source, const std::string &target, const std::string &type, const int64_t &flags, const std::string &data) |
Declare mount that will be created while zone startup. More... | |
std::string | declareLink (const std::string &source, const std::string &target) |
Declare link that will be created while zone startup. More... | |
void | start () noexcept |
void | stop () noexcept |
std::vector< std::string > | list () const |
List all provisioned resources. More... | |
void | remove (const std::string &item) |
Remove resource. More... | |
Private Member Functions | |
void | saveProvisioningConfig () |
std::string | declareProvision (ZoneProvisioningConfig::Provision &&provision) |
void | mount (const ZoneProvisioningConfig::Mount &config) |
void | umount (const ZoneProvisioningConfig::Mount &config) |
void | file (const ZoneProvisioningConfig::File &config) |
void | link (const ZoneProvisioningConfig::Link &config) |
Static Private Member Functions | |
static std::string | getId (const ZoneProvisioningConfig::File &file) |
static std::string | getId (const ZoneProvisioningConfig::Mount &mount) |
static std::string | getId (const ZoneProvisioningConfig::Link &link) |
static std::string | getId (const ZoneProvisioningConfig::Provision &provision) |
Private Attributes | |
ZoneProvisioningConfig | mProvisioningConfig |
std::string | mRootPath |
std::string | mDbPath |
std::string | mDbPrefix |
std::vector< std::string > | mValidLinkPrefixes |
std::list < ZoneProvisioningConfig::Provision > | mProvisioned |
Class is responsible for prepare filesystem for zone It allows to create directories, files, mount points and copying files from host.
vasum::ZoneProvision::ZoneProvision | ( | const std::string & | rootPath, |
const std::string & | configPath, | ||
const std::string & | dbPath, | ||
const std::string & | dbPrefix, | ||
const std::vector< std::string > & | validLinkPrefixes | ||
) |
ZoneProvision constructor.
rootPath | zone root path |
configPath | path to config with defaults |
dbPath | path to database |
dbPrefix | database prefix |
validLinkPrefixes | valid link prefixes |
vasum::ZoneProvision::~ZoneProvision | ( | ) |
|
delete |
|
default |
std::string vasum::ZoneProvision::declareFile | ( | const int32_t & | type, |
const std::string & | path, | ||
const int32_t & | flags, | ||
const int32_t & | mode | ||
) |
Declare file, directory or pipe that will be created while zone startup.
std::string vasum::ZoneProvision::declareLink | ( | const std::string & | source, |
const std::string & | target | ||
) |
Declare link that will be created while zone startup.
std::string vasum::ZoneProvision::declareMount | ( | const std::string & | source, |
const std::string & | target, | ||
const std::string & | type, | ||
const int64_t & | flags, | ||
const std::string & | data | ||
) |
Declare mount that will be created while zone startup.
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |
std::vector< std::string > vasum::ZoneProvision::list | ( | ) | const |
List all provisioned resources.
|
private |
|
delete |
void vasum::ZoneProvision::remove | ( | const std::string & | item | ) |
Remove resource.
item | resource to be removed (as in list()) |
|
private |
|
noexcept |
|
noexcept |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |