[Bug/Feature] Remove start functionality, add VT support.
[Cause] N/A
[Solution] N/A
[Verification] Build, install, run tests
Change-Id: I67a7eebf6e45bb2cab29e833fbf53c1bdaeb88fb
Signed-off-by: Dariusz Michaluk <d.michaluk@samsung.com>
{
"zoneConfigs" : ["zones/private.conf", "zones/business.conf"],
"zonesPath" : "${DATA_DIR}/.zones",
- "zoneImagePath" : "${DATA_DIR}/.zones/img/system-data.img",
+ "zoneImagePath" : "",
"zoneTemplatePath" : "templates",
"zoneNewConfigPrefix" : "/var/lib/vasum",
"runMountPointPrefix" : "/var/run/zones",
{
"name" : "~NAME~",
- "lxcTemplate" : "template.sh",
+ "lxcTemplate" : "tizen-common-wayland.sh",
"initWithArgs" : [],
"ipv4Gateway" : "10.0.~IP~.1",
"ipv4" : "10.0.~IP~.2",
"cpuQuotaForeground" : -1,
"cpuQuotaBackground" : 1000,
"privilege" : 10,
- "vt" : -1,
+ "vt" : ~VT~,
"switchToDefaultAfterTimeout" : true,
"enableDbusIntegration" : true,
"runMountPoint" : "~NAME~/run",
const boost::regex ZONE_NAME_REGEX("~NAME~");
const boost::regex ZONE_IP_THIRD_OCTET_REGEX("~IP~");
+const boost::regex ZONE_VT_REGEX("~VT~");
const unsigned int ZONE_IP_BASE_THIRD_OCTET = 100;
+const unsigned int ZONE_VT_BASE = 1;
} // namespace
LOGD("IP third octet: " << thirdOctetStr);
resultConfig = boost::regex_replace(resultConfig, ZONE_IP_THIRD_OCTET_REGEX, thirdOctetStr);
+ // generate first free VT number
+ // TODO change algorithm after implementing removeZone
+ std::string freeVT = std::to_string(ZONE_VT_BASE + mZones.size() + 1);
+ LOGD("VT number: " << freeVT);
+ resultConfig = boost::regex_replace(resultConfig, ZONE_VT_REGEX, freeVT);
+
if (!utils::saveFileContent(resultPath, resultConfig)) {
LOGE("Faield to save new config file.");
throw ZoneOperationException("Failed to save new config file.");
return;
}
- auto resultCallback = [this, id, result](bool succeeded) {
- if (succeeded) {
- focus(id);
- result->setVoid();
- } else {
- LOGE("Failed to start zone.");
- // TODO removeZone
- result->setError(api::ERROR_INTERNAL, "Failed to start zone");
- }
- };
- mZones[id]->startAsync(resultCallback);
+ result->setVoid();
}
void ZonesManager::handleDestroyZoneCall(const std::string& id,
dbus.callAsyncMethodCreateZone(zone1, resultCallback);
BOOST_REQUIRE(callDone.wait(EVENT_TIMEOUT));
- BOOST_CHECK_EQUAL(cm.getRunningForegroundZoneId(), zone1);
-
// create zone2
dbus.callAsyncMethodCreateZone(zone2, resultCallback);
BOOST_REQUIRE(callDone.wait(EVENT_TIMEOUT));
- BOOST_CHECK_EQUAL(cm.getRunningForegroundZoneId(), zone2); //TODO is this valid?
// create zone3
dbus.callAsyncMethodCreateZone(zone3, resultCallback);
BOOST_REQUIRE(callDone.wait(EVENT_TIMEOUT));
+
+ cm.startAll();
+
BOOST_CHECK_EQUAL(cm.getRunningForegroundZoneId(), zone3);
// destroy zone2