2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Contact: Mateusz Malicki <m.malicki2@samsung.com>
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License
21 * @author Mateusz Malicki (m.malicki2@samsung.com)
22 * @brief Declaration of the class for managing zone provision
26 #ifndef SERVER_ZONE_PROVISION_HPP
27 #define SERVER_ZONE_PROVISION_HPP
29 #include "zone-provision-config.hpp"
38 * Class is responsible for prepare filesystem for zone
39 * It allows to create directories, files, mount points and copying files from host
45 * ZoneProvision constructor
46 * @param zonesPath directory where zones are defined (lxc configs, rootfs etc)
48 ZoneProvision(const std::string& zonePath,
49 const std::vector<std::string>& validLinkPrefixes);
52 * Declare file, directory or pipe that will be created while zone startup
54 void declareFile(const int32_t& type,
55 const std::string& path,
59 * Declare mount that will be created while zone startup
61 void declareMount(const std::string& source,
62 const std::string& target,
63 const std::string& type,
65 const std::string& data);
67 * Declare link that will be created while zone startup
69 void declareLink(const std::string& source,
70 const std::string& target);
75 std::string getRootPath() const;
77 void start() noexcept;
81 ZoneProvisioning mProvisioningConfig;
82 std::string mRootPath;
83 std::string mProvisionFile;
84 std::vector<std::string> mValidLinkPrefixes;
86 void mount(const ZoneProvisioning::Mount& config);
87 void umount(const ZoneProvisioning::Mount& config);
88 void file(const ZoneProvisioning::File& config);
89 void link(const ZoneProvisioning::Link& config);
95 #endif // SERVER_ZONE_PROVISION_HPP