From: Dariusz Michaluk Date: Mon, 15 Dec 2014 11:36:25 +0000 (+0100) Subject: Adding support for --vt option in lxc-templates X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6de4eeceb5f669eb2fe71cf0a3d5d755e2663f8d;p=platform%2Fcore%2Fsecurity%2Fvasum.git Adding support for --vt option in lxc-templates [Bug/Feature] N/A [Cause] N/A [Solution] N/A [Verification] Build, install, run tests Change-Id: I11049b06922f763e168449d43cf6dd9527ea9324 Signed-off-by: Dariusz Michaluk --- diff --git a/server/configs/lxc-templates/template.sh b/server/configs/lxc-templates/template.sh index c73bd01..e7d5533 100755 --- a/server/configs/lxc-templates/template.sh +++ b/server/configs/lxc-templates/template.sh @@ -2,7 +2,7 @@ echo LXC template, args: $@ -options=$(getopt -o p:n: -l rootfs:,path:,name:,ipv4:,ipv4-gateway: -- "$@") +options=$(getopt -o p:n: -l path:,rootfs:,name:,vt:,ipv4:,ipv4-gateway: -- "$@") if [ $? -ne 0 ]; then exit 1 fi @@ -14,6 +14,7 @@ do -p|--path) path=$2; shift 2;; --rootfs) rootfs=$2; shift 2;; -n|--name) name=$2; shift 2;; + --vt) vt=$2; shift 2;; --ipv4) ipv4=$2; shift 2;; --ipv4-gateway) ipv4_gateway=$2; shift 2;; --) shift 1; break ;; diff --git a/server/zone-admin.cpp b/server/zone-admin.cpp index 42c71ea..46c4974 100644 --- a/server/zone-admin.cpp +++ b/server/zone-admin.cpp @@ -71,6 +71,11 @@ ZoneAdmin::ZoneAdmin(const std::string& zonesPath, args.add("--ipv4"); args.add(config.ipv4.c_str()); } + const std::string vt = std::to_string(config.vt); + if (config.vt > 0) { + args.add("--vt"); + args.add(vt.c_str()); + } if (!mZone.create(lxcTemplate, args.c_array())) { throw ZoneOperationException("Could not create zone"); }