57 const std::shared_ptr<const IDobbySettings>& settings,
59 const std::shared_ptr<const DobbyBundle>& bundle,
60 const std::string& specJson);
62 const std::shared_ptr<const IDobbySettings>& settings,
63 const std::shared_ptr<const DobbyBundle>& bundle,
64 const std::string& specJson);
71 const std::string spec()
const override;
74 uid_t userId()
const override;
75 gid_t groupId()
const override;
83 bool restartOnCrash()
const override;
86 std::shared_ptr<rt_dobby_schema> config()
const override;
89 const std::string& etcHosts()
const;
90 const std::string& etcServices()
const;
91 const std::string& etcPasswd()
const;
92 const std::string& etcGroup()
const;
93 const std::string& etcLdSoPreload()
const;
96 bool consoleDisabled()
const override;
97 ssize_t consoleLimit()
const override;
98 const std::string& consolePath()
const override;
101 const std::map<std::string, Json::Value>& legacyPlugins()
const override;
102 const std::map<std::string, Json::Value>& rdkPlugins()
const override;
107 enum Type { Directory, File } type;
108 std::string destination;
110 std::vector<MountPoint> mountPoints()
const;
113 const std::string& rootfsPath()
const override;
116 bool parseSpec(ctemplate::TemplateDictionary* dictionary,
117 const std::string& json,
121 #define JSON_FIELD_PROCESSOR(x) \
122 bool x(const Json::Value&, ctemplate::TemplateDictionary*)
124 JSON_FIELD_PROCESSOR(processAppId);
125 JSON_FIELD_PROCESSOR(processEnv);
126 JSON_FIELD_PROCESSOR(processArgs);
127 JSON_FIELD_PROCESSOR(processCwd);
128 JSON_FIELD_PROCESSOR(processConsole);
129 JSON_FIELD_PROCESSOR(processUser);
130 JSON_FIELD_PROCESSOR(processUserNs);
131 JSON_FIELD_PROCESSOR(processEtc);
132 JSON_FIELD_PROCESSOR(processNetwork);
133 JSON_FIELD_PROCESSOR(processRtPriority);
134 JSON_FIELD_PROCESSOR(processRestartOnCrash);
135 JSON_FIELD_PROCESSOR(processMounts);
136 JSON_FIELD_PROCESSOR(processLegacyPlugins);
137 JSON_FIELD_PROCESSOR(processMemLimit);
138 JSON_FIELD_PROCESSOR(processGpu);
139 JSON_FIELD_PROCESSOR(processVpu);
140 JSON_FIELD_PROCESSOR(processDbus);
141 JSON_FIELD_PROCESSOR(processSyslog);
142 JSON_FIELD_PROCESSOR(processCpu);
143 JSON_FIELD_PROCESSOR(processDevices);
144 JSON_FIELD_PROCESSOR(processCapabilities);
145 JSON_FIELD_PROCESSOR(processSeccomp);
147 #undef JSON_FIELD_PROCESSOR
150 ctemplate::TemplateDictionary* dictionary,
151 Json::Value& loopMntData);
155 const Json::Value& pluginData);
157 ctemplate::TemplateDictionary* dictionary);
161 template <std::
size_t N>
162 std::bitset<N>
parseBitset(
const std::string& str)
const;
166 const std::string &source,
167 const std::string &destination);
170 std::string
jsonToString(
const Json::Value& jsonObject);
173 static void addGpuDevNodes(
const std::shared_ptr<const IDobbySettings::HardwareAccessSettings> &settings,
174 ctemplate::TemplateDictionary *dict);
176 static void addVpuDevNodes(
const std::shared_ptr<const IDobbySettings::HardwareAccessSettings> &settings,
177 ctemplate::TemplateDictionary *dict);
180 const std::shared_ptr<IDobbyUtils> mUtilities;
181 const std::shared_ptr<const IDobbySettings::HardwareAccessSettings> mGpuSettings;
182 const std::shared_ptr<const IDobbySettings::HardwareAccessSettings> mVpuSettings;
183 const std::vector<std::string> mDefaultPlugins;
184 const Json::Value mRdkPluginsData;
188 ctemplate::TemplateDictionary* mDictionary;
192 Json::Value mRdkPluginsJson;
193 std::shared_ptr<rt_dobby_schema> mConf;
196 enum class SpecVersion {
207 bool mRestartOnCrash;
215 bool mConsoleDisabled;
216 std::string mConsolePath;
217 ssize_t mConsoleLimit;
220 std::map<std::string, Json::Value> mLegacyPlugins;
221 std::map<std::string, Json::Value> mRdkPlugins;
224 std::vector<MountPoint> mMountPoints;
227 std::string mEtcHosts;
228 std::string mEtcServices;
229 std::string mEtcPasswd;
230 std::string mEtcGroup;
231 std::string mEtcLdSoPreload;
234 static int mNumCores;
237 static const std::map<std::string, int> mAllowedCaps;
240 std::string mRootfsPath;