2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Contact: Michal Witanowski <m.witanowski@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 Michal Witanowski (m.witanowski@samsung.com)
22 * @brief Declaration of the class for storing zone configuration
26 #ifndef SERVER_ZONE_CONFIG_HPP
27 #define SERVER_ZONE_CONFIG_HPP
29 #include "config/fields.hpp"
41 * Zone template name (relative to zoneTemplateDir)
43 std::string zoneTemplate;
46 * Init program with args (empty means default /sbin/init)
48 std::vector<std::string> initWithArgs;
51 * Privilege of the zone.
52 * The smaller the value the more important the zone
57 * Allow switching to default zone after timeout.
58 * Setting this to false will disable switching to default zone after timeout.
60 bool switchToDefaultAfterTimeout;
63 * Zone's CFS quota in us when it's in the foreground
65 std::int64_t cpuQuotaForeground;
68 * Zone's CFS quota in us when it's in the background
70 std::int64_t cpuQuotaBackground;
73 * Valid hard link prefixes.
75 std::vector<std::string> validLinkPrefixes;
78 * Timeout in seconds for zone to gracefully shut down.
79 * After given time, if Zone is not off, forced shutdown occurs.
81 * To wait forever, set -1 timeout. To skip waiting, set 0 timeout.
89 privilege, // TODO not needed?
90 switchToDefaultAfterTimeout, // TODO move to dynamic and add an API to change
98 struct ZoneDynamicConfig {
101 * Requested zone state after restore
103 std::string requestedState;
106 * IP v4 gateway address
108 std::string ipv4Gateway;
116 * Number of virtual terminal used by xserver inside zone
121 * Path to zones dbus unix socket
123 std::string runMountPoint;
135 struct ZoneTemplatePathConfig {
137 * A path to zone template config (containing default values)
139 std::string zoneTemplatePath;
141 CONFIG_REGISTER(zoneTemplatePath)
146 #endif // SERVER_ZONE_CONFIG_HPP