2 * Copyright (C) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License version 2.1 as published by the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 * @author Lukasz Pawelczyk (l.pawelczyk@samsung.com)
21 * @brief A definition of a ContainerConfig struct
24 #ifndef LXCPP_CONTAINER_CONFIG_HPP
25 #define LXCPP_CONTAINER_CONFIG_HPP
27 #include "lxcpp/logger-config.hpp"
28 #include "lxcpp/network-config.hpp"
30 #include <config/config.hpp>
31 #include <config/fields.hpp>
35 #include <sys/types.h>
41 struct ContainerConfig {
43 * Name of the container.
45 * Set: by constructor, cannot be changed afterwards.
51 * Path of the root directory of the container.
53 * Set: by contstructor, cannot be changed afterwards.
56 std::string mRootPath;
59 * Pid of the guard process.
61 * Set: automatically by the guard process itself.
67 * Pid of the container's init process.
69 * Set: automatically by the guard process.
75 * Container network configration
77 * Set: by container network config methods
80 NetworkConfig mNetwork;
83 * Argv of the container's init process to be executed.
84 * The path has to be relative to the RootPath.
89 std::vector<std::string> mInit;
92 * Logger to be configured inside the guard process. This logger
93 * reconfiguration is due to the fact that guard looses standard file
94 * descriptors and might loose access to other files by mount namespace
95 * usage. Hence an option to set some other logger that will work
96 * regardless. E.g. PersistentFile.
101 LoggerConfig mLogger;
103 ContainerConfig() : mGuardPid(-1), mInitPid(-1) {}
120 #endif // LXCPP_CONTAINER_CONFIG_HPP