Adding support for --vt option in lxc-templates 83/32083/4
authorDariusz Michaluk <d.michaluk@samsung.com>
Mon, 15 Dec 2014 11:36:25 +0000 (12:36 +0100)
committerDariusz Michaluk <d.michaluk@samsung.com>
Tue, 16 Dec 2014 14:43:04 +0000 (06:43 -0800)
[Bug/Feature]   N/A
[Cause]         N/A
[Solution]      N/A
[Verification]  Build, install, run tests

Change-Id: I11049b06922f763e168449d43cf6dd9527ea9324
Signed-off-by: Dariusz Michaluk <d.michaluk@samsung.com>
server/configs/lxc-templates/template.sh
server/zone-admin.cpp

index c73bd01..e7d5533 100755 (executable)
@@ -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 ;;
index 42c71ea..46c4974 100644 (file)
@@ -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");
         }