base image option: add base image binary version to launch config file
authorjihye424.kim <jihye424.kim@samsung.com>
Thu, 24 Dec 2015 08:04:12 +0000 (17:04 +0900)
committerjihye424.kim <jihye424.kim@samsung.com>
Thu, 24 Dec 2015 08:31:37 +0000 (17:31 +0900)
Change-Id: Ia501bf5bdd53e1bedd864e72dd4c377a4e9b4306
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
src/org/tizen/emulator/manager/platform/BaseImage.java
src/org/tizen/emulator/manager/vms/Creator.java
src/org/tizen/emulator/manager/vms/option/BaseImageOption.java
src/org/tizen/emulator/manager/vms/option/OPTION_KEY.java

index e768dd9..68590d9 100644 (file)
@@ -273,9 +273,9 @@ public class BaseImage {
                version = platform.getVersion();
                profile = platform.getProfile();
                type = "custom"; // TODO //$NON-NLS-1$
-               cpu     = findCpuTypeFromPath(); //$NON-NLS-1$
+               cpu     = findCpuTypeFromPath();
                skinShape = SKIN_SHAPE.NONE; // TODO
-               binaryVersion = ""; //$NON-NLS-1$
+               binaryVersion = "Custom"; //$NON-NLS-1$
                extension = platform.isChildPlatform()
                                ? platform.getPlugin().getAttribute(PluginStringResources.Extension)
                                : "";
index 35eeb2c..e06c2ca 100644 (file)
@@ -305,7 +305,7 @@ public class Creator {
                ec.getBaseInformation().getDiskImage().getBaseDiskImage().setFormat("qcow2"); //$NON-NLS-1$
                ec.getBaseInformation().getDiskImage().getBaseDiskImage().setValue(newVM.baseImagePath);
 
-               if (!newVM.baseImage.getBinaryVersion().isEmpty()) {
+               if (newVM.baseImage.isStandard() && !newVM.baseImage.getBinaryVersion().isEmpty()) {
                        ec.getBaseInformation().getDiskImage().getBaseDiskImage().setVersion(newVM.baseImage.getBinaryVersion());
                }
                ec.getBaseInformation().getDiskImage().getCurrentDiskImage().setFormat("qcow2"); //$NON-NLS-1$
index d2367fa..4049a72 100644 (file)
@@ -36,7 +36,9 @@ public class BaseImageOption extends Option {
 
        @Override
        public void getLaunchArgument(LaunchConfig config, VMProperty property) {
-
+               if (property.getPropertyValue().baseImage != null) {
+                       config.addVariable(OPTION_KEY.VAR_IMAGE_VER, property.getPropertyValue().baseImage.getBinaryVersion());
+               }
                config.addVariableWithSpace(OPTION_KEY.VAR_DRIVE, "file=${vms_path}" + File.separator + "${vm_name}" //$NON-NLS-1$ //$NON-NLS-2$
                                + File.separator + "emulimg-${vm_name}." + varForm(OPTION_KEY.VAR_IMAGE_ARCH) //$NON-NLS-1$
                                + ",if=none,index=1,cache.no-flush=on"); //$NON-NLS-1$
index 4838d28..dcb3f94 100644 (file)
@@ -58,7 +58,8 @@ public enum OPTION_KEY {
        VAR_STILL_IMAGE_PATH("still_image_path"), //$NON-NLS-1$
        VAR_PROFILE("profile"),
        VAR_WSI("wsi"),
-       VAR_SHARING_PATH("sharing_path");
+       VAR_SHARING_PATH("sharing_path"),
+       VAR_IMAGE_VER("image_ver");
 
        String variable;
        OPTION_KEY(String var) {