[Title] emulator manager : modify source to support 'ARM' emulator.
authorjihye kim <jihye1128.kim@samsung.com>
Tue, 25 Sep 2012 06:38:01 +0000 (15:38 +0900)
committerjihye kim <jihye1128.kim@samsung.com>
Tue, 25 Sep 2012 06:38:01 +0000 (15:38 +0900)
[Desc.] modify source to support 'ARM' emulator.
[Issue] N/A

src/org/tizen/emulator/manager/console/ConsoleCreateVM.java
src/org/tizen/emulator/manager/console/ConsoleProcessor.java
src/org/tizen/emulator/manager/ui/CloneDialog.java
src/org/tizen/emulator/manager/ui/detail/TableWidget.java
src/org/tizen/emulator/manager/vms/Creator.java
src/org/tizen/emulator/manager/vms/EmulatorVMs.java
src/org/tizen/emulator/manager/vms/Launcher.java
src/org/tizen/emulator/manager/vms/VMCreateHelper.java
src/org/tizen/emulator/manager/vms/VMPropertyValue.java
src/org/tizen/emulator/manager/vms/VMsWorker.java

index 87b57bf..7dc1d1f 100644 (file)
@@ -30,6 +30,7 @@
 package org.tizen.emulator.manager.console;
 
 import java.io.File;
+import java.io.IOException;
 import java.util.ArrayList;
 
 import org.tizen.emulator.manager.EmulatorManager;
@@ -39,6 +40,7 @@ import org.tizen.emulator.manager.tool.CheckVirtualization;
 import org.tizen.emulator.manager.tool.SelectSkin;
 import org.tizen.emulator.manager.ui.detail.VMPropertyView;
 import org.tizen.emulator.manager.vms.Creator;
+import org.tizen.emulator.manager.vms.EmulatorVMs;
 import org.tizen.emulator.manager.vms.RAM_SIZE;
 import org.tizen.emulator.manager.vms.RESOLUTION;
 import org.tizen.emulator.manager.vms.VMCreateHelper;
@@ -88,8 +90,14 @@ public class ConsoleCreateVM {
                                                checkVMName(c.getCurrentValue());
                                                prop.vmsName = c.getCurrentValue();
                                        } else if (c.getShortName() == "p") {
-                                               checkImagePath(c.getCurrentValue());
-                                               prop.baseImagePath = c.getCurrentValue();
+                                               prop.baseImagePath = checkImagePath(c.getCurrentValue());
+                                               if (prop.baseImagePath.endsWith(".x86")) {
+                                                       EmulatorVMs.getInstance().CustomArch = "x86";
+                                               } else if (prop.baseImagePath.endsWith(".arm")) {
+                                                       EmulatorVMs.getInstance().CustomArch = "arm";
+                                               } else {
+                                                       throw new ConsoleException("Avaliable format of base image is .x86 or .arm.");
+                                               }
                                        } else {
                                                // Options
                                                setOptions(c, prop);
@@ -134,6 +142,7 @@ public class ConsoleCreateVM {
                                                                        prop.baseName           = image.getName();
                                                                        prop.baseImagePath      = image.getPath();
                                                                        prop.baseImagePathName = image.getImagePathName();
+                                                                       prop.archType           = image.getCpu();
                                                                        break;
                                                                }
                                                        }
@@ -299,8 +308,7 @@ public class ConsoleCreateVM {
                                        "Valid Charater : a-z, A-Z, 0-9, 0, _");
                }
 
-               //TODO : x86
-               if (helper.checkDupulicateName(name, "x86")) {
+               if (helper.checkDupulicateName(name)) {
                        throw new ConsoleException("The name (" + name + ") already exists!");
                }
 
@@ -309,7 +317,7 @@ public class ConsoleCreateVM {
                }
        }
 
-       private void checkImagePath(String value) throws ConsoleException {
+       private String checkImagePath(String value) throws ConsoleException {
                if (value == null || value.isEmpty()) {
                        throw new ConsoleException("Path of disk image is empty.");
                }
@@ -318,5 +326,11 @@ public class ConsoleCreateVM {
                if (!f.exists()) {
                        throw new ConsoleException("This directory does not exist. (Path : " + value + ")");
                }
+
+               try {
+                       return f.getCanonicalPath();
+               } catch (IOException e) {
+                       throw new ConsoleException("Path of base image has problem : \n" + e.getMessage());
+               }
        }
 }
index a34d3db..f8368bd 100644 (file)
@@ -289,7 +289,7 @@ public class ConsoleProcessor {
 
                try {
                        if (f.isDirectory()) {
-                               path = path + File.separator + "emulimg-" + name;
+                               path = path + File.separator + "emulimg-" + name + "." + prop.getArch().toString();
                        }
                        prop.getWorker().createNewBaseImage(prop, path);
                } catch (VMsWorkerException e) {
index 5a7ebb9..91d8d27 100644 (file)
@@ -167,7 +167,7 @@ public class CloneDialog {
                        return;
                }
 
-               if (helper.checkDupulicateName(vmName, property.getArch().toString())) {
+               if (helper.checkDupulicateName(vmName)) {
                        infoLabel.setText("The same name already exists!");
                        confirmButton.setEnabled(false);
                        return;
index 573ebdb..8f3f147 100644 (file)
@@ -54,6 +54,7 @@ import org.tizen.emulator.manager.ui.MenuHandling;
 import org.tizen.emulator.manager.ui.MessageDialog;
 import org.tizen.emulator.manager.ui.ResourceRegistry;
 import org.tizen.emulator.manager.ui.ResourceRegistry.ImageName;
+import org.tizen.emulator.manager.vms.EmulatorVMs;
 import org.tizen.emulator.manager.vms.RESOLUTION;
 import org.tizen.emulator.manager.vms.VMCreateHelper;
 import org.tizen.emulator.manager.vms.VMPropertyValue;
@@ -262,7 +263,6 @@ class BaseImageButton extends TableWidget {
        private Button baseImageButton;
        private String newPath;
        private String newPathName;
-       private String arch;
        private Image image;
        private FileDialog baseImageFD;
        private boolean isSelected;
@@ -288,7 +288,6 @@ class BaseImageButton extends TableWidget {
        }
 
        public boolean settingWidget(Table table, VMPropertyValue value) {
-               arch = value.archType;
                newPath         = value.baseImagePath;
                newPathName = value.baseImagePathName;
                baseImageButton = new Button(table, SWT.PUSH);
@@ -318,9 +317,9 @@ class BaseImageButton extends TableWidget {
                                        baseImageFD = new FileDialog(
                                                        EmulatorManager.getInstance().getMainDialog().getShell(),
                                                        SWT.OPEN);
-                                       baseImageFD.setText(String.format("Select existing Base Image(%s)", arch));
-                                       String[] filter = {String.format("*.%s", arch)};
-                                       String[] filterName = {String.format("Disk Image Files(*.%s)", arch)};
+                                       baseImageFD.setText(String.format("Select existing Base Image"));
+                                       String[] filter = {"*.x86", "*.arm"};
+                                       String[] filterName = {"Disk Image Files(*.x86)", "Disk Image Files(*.arm)"};
                                        baseImageFD.setFilterExtensions(filter);
                                        baseImageFD.setFilterNames(filterName);
                                }
@@ -334,6 +333,9 @@ class BaseImageButton extends TableWidget {
                                        }
                                        newPath = path;
                                        newPathName = path.substring(path.lastIndexOf(File.separator) + 1, path.length());
+
+                                       EmulatorVMs.getInstance().CustomArch = newPathName.endsWith("x86") ? "x86" : "arm";
+
                                        baseImageButton.setText(newPathName);
                                        isSelected = true;
                                        ((NameText)TableWidgetList.getInstance().findVMWidget("name", isCreateMode())).checkImageName();
index 94ceae4..90dae9b 100644 (file)
@@ -36,7 +36,6 @@ import java.util.List;
 
 import org.tizen.emulator.manager.tool.FilePath;
 import org.tizen.emulator.manager.tool.StringResource;
-import org.tizen.emulator.manager.vms.VMsProperty.Architecture;
 import org.tizen.emulator.manager.vms.xml.EmulatorConfiguration;
 import org.tizen.emulator.manager.vms.xml.ObjectFactory;
 
@@ -115,7 +114,8 @@ public class Creator {
                checkCustomBaseImage(newVM.baseImagePath);
 
                customPath = folder.getAbsolutePath() + File.separator + "emulimg-" + 
-                               newVM.vmsName + "." + Architecture.x86.toString();
+                               newVM.vmsName + "." + (newVM.isStandard ? newVM.archType.toString() : EmulatorVMs.getInstance().CustomArch.toString());
+
                createInitialVMImageInternal(newVM.baseImagePath, customPath);
 
                String swap_base_path   = FilePath.getInstance().getSwapPath() + File.separator + StringResource.SWAP_IMAGE;
@@ -199,9 +199,9 @@ public class Creator {
                // TODO
                if (newVM.getSkin() != null) {
                        newVM.skinPath = newVM.getSkin().findSkinPath(newVM.resolution.getValue());
-               } else {
+               }/*else {
                        newVM.skinPath = null;
-               }
+               }*/
        }
 
        private void createRam() {}
@@ -216,7 +216,7 @@ public class Creator {
                ec.setDevice(factory.createDeviceType());
 
                ec.getBaseInformation().setName(newVM.vmsName);
-               ec.getBaseInformation().setArchitecture(Architecture.x86.toString());
+               ec.getBaseInformation().setArchitecture(newVM.archType.toString());
 
                ec.getBaseInformation().setDiskImage(factory.createBaseInformationTypeDiskImage());
                if (newVM.isStandard) {
@@ -233,6 +233,7 @@ public class Creator {
                        }
                } else {
                        ec.getBaseInformation().getDiskImage().setType("custom");
+                       ec.getBaseInformation().setArchitecture(EmulatorVMs.getInstance().CustomArch);
                }
 
                //
index 8b964a2..955c35a 100644 (file)
@@ -64,6 +64,8 @@ public class EmulatorVMs {
        static String vmsBaseDirectoryName = "";
        static String vmsConfigDirectory   = "";
 
+       public String CustomArch = "x86";
+
        public static void makeSDKDataPath(String sdkDataPath) {
                if (sdkDataPath == null || sdkDataPath.equals("")) {
                        tizenSdkDataPath = System.getProperty("user.home")
index a0fe07b..c453e02 100644 (file)
@@ -76,10 +76,18 @@ public class Launcher {
                        return null;
                }
 
-               if (System.getProperty("os.name").toLowerCase().indexOf("windows") > -1) {
-                       binary = "emulator-x86.exe";
+               if (property.getArch().toString().equals("x86")) {
+                       if (System.getProperty("os.name").toLowerCase().indexOf("windows") > -1) {
+                               binary = "emulator-x86.exe";
+                       } else {
+                               binary = "emulator-x86";
+                       }
                } else {
-                       binary = "emulator-x86";
+                       if (System.getProperty("os.name").toLowerCase().indexOf("windows") > -1) {
+                               binary = "emulator-arm.exe";
+                       } else {
+                               binary = "emulator-arm";
+                       }
                }
 
                // check disk image
@@ -140,39 +148,40 @@ public class Launcher {
                        cmd.add("skin.path=" + skinPath);
                }
                cmd.add("--qemu-args");
-               cmd.add("-drive");
-               //cmd.add("file=" + EmulatorVMs.getInstance().getVMsBaseDirectory() + File.separator + property.getArch().toString() + File.separator + property.getName() + File.separator +"emulimg-" + property.getName() + ".x86,if=virtio");
-               cmd.add("file=" + property.getConfiguration().getBaseInformation().getDiskImage().getCurrentDiskImage().getValue()+ ",if=virtio,index=1");
-               cmd.add( "-boot");
-               cmd.add("c");
-               cmd.add("-append");
-               /* is linux and use fileshare [kernel option] */
-               if(isLinux > -1 && isFileshare) { 
-                       cmd.add("console=ttyS0 video=uvesafb:ywrap,"
-                               + width
-                               + "x" 
-                               + height 
-                               + "-32@60"
-                               + " dpi=" + property.getConfiguration().getDevice().getDisplay().getDensity().getValue() * 10 
-                               + " ip=10.0.2.16::10.0.2.2:255.255.255.0::eth0:none 5 virtio-9p");
-               }
-               else {
-                       cmd.add("console=ttyS0 video=uvesafb:ywrap,"
-                                       + width
-                                       + "x" 
-                                       + height 
-                                       + "-32@60"
-                                       + " dpi=" + property.getConfiguration().getDevice().getDisplay().getDensity().getValue() * 10 
-                                       + " ip=10.0.2.16::10.0.2.2:255.255.255.0::eth0:none 5");
-               }
-               /* is linux and use fileshare [non-kernel option] */
-               if(isLinux > -1 && isFileshare) {
-                       cmd.add("-virtfs");
-                       cmd.add("local,path=" + property.getConfiguration().getUsability().getFileSharing().getPath() +",security_model=none,mount_tag=fileshare");
-               }
+               // x86 part of cmd
+               if (property.getArch().toString().equals("x86")) {
+                       cmd.add("-drive");
+                       cmd.add("file=" + property.getConfiguration().getBaseInformation().getDiskImage().getCurrentDiskImage().getValue()+ ",if=virtio,index=1");
+                       cmd.add( "-boot");
+                       cmd.add("c");
+                       cmd.add("-append");
+                       /* is linux and use fileshare [kernel option] */
+                       if(isLinux > -1 && isFileshare) {
+                               cmd.add("console=ttyS0 video=uvesafb:ywrap,"
+                                               + width
+                                               + "x"
+                                               + height
+                                               + "-32@60"
+                                               + " dpi=" + property.getConfiguration().getDevice().getDisplay().getDensity().getValue() * 10
+                                               + " ip=10.0.2.16::10.0.2.2:255.255.255.0::eth0:none 5 virtio-9p");
+                       }
+                       else {
+                               cmd.add("console=ttyS0 video=uvesafb:ywrap,"
+                                               + width
+                                               + "x"
+                                               + height
+                                               + "-32@60"
+                                               + " dpi=" + property.getConfiguration().getDevice().getDisplay().getDensity().getValue() * 10
+                                               + " ip=10.0.2.16::10.0.2.2:255.255.255.0::eth0:none 5");
+                       }
+                       /* is linux and use fileshare [non-kernel option] */
+                       if(isLinux > -1 && isFileshare) {
+                               cmd.add("-virtfs");
+                               cmd.add("local,path=" + property.getConfiguration().getUsability().getFileSharing().getPath() +",security_model=none,mount_tag=fileshare");
+                       }
 
-               /* is windows XP and use fileshare */
-               if(isWindows > -1 && osVersion.equals("5.1") && isFileshare) { 
+                       /* is windows XP and use fileshare */
+                       if(isWindows > -1 && osVersion.equals("5.1") && isFileshare) {
                                /* delete if fileshare with the same name existed */
                                List<String> cmd2 = new ArrayList<String>();
                                cmd2.add("net");
@@ -189,7 +198,7 @@ public class Launcher {
                                        }
                                        logger.log(Level.WARNING, "Failed to execute fileshare command.\n" + e.getMessage());
                                }
-                               
+
                                /* start net share */
                                List<String> cmd3 = new ArrayList<String>();
                                cmd3.add("net");
@@ -205,71 +214,123 @@ public class Launcher {
                                        }
                                        logger.log(Level.WARNING, "Failed to execute fileshare command.\n" + e.getMessage());
                                }
-               }
-               /* is windows 7 and use fileshare */
-               else if(isWindows > -1 && osVersion.equals("6.1") && isFileshare) {
+                       }
+                       /* is windows 7 and use fileshare */
+                       else if(isWindows > -1 && osVersion.equals("6.1") && isFileshare) {
                        /* delete if fileshare with the same name existed */
-                       List<String> cmd2 = new ArrayList<String>();
-                       cmd2.add("net");
-                       cmd2.add("share");
-                       cmd2.add("emulator-" + portNo);
-                       cmd2.add("/delete");
-                       logger.log(Level.INFO, cmd2.toString());
-                       ProcessBuilder pb2 = new ProcessBuilder(cmd2);
-                       try {
-                               pb2.start();
-                       } catch (IOException e) {
-                               if (!isConsole) {
-                                       new MessageDialog().openWarningDialog("Failed to execute fileshare command.\n" + e.getMessage());
+                               List<String> cmd2 = new ArrayList<String>();
+                               cmd2.add("net");
+                               cmd2.add("share");
+                               cmd2.add("emulator-" + portNo);
+                               cmd2.add("/delete");
+                               logger.log(Level.INFO, cmd2.toString());
+                               ProcessBuilder pb2 = new ProcessBuilder(cmd2);
+                               try {
+                                       pb2.start();
+                               } catch (IOException e) {
+                                       if (!isConsole) {
+                                               new MessageDialog().openWarningDialog("Failed to execute fileshare command.\n" + e.getMessage());
+                                       }
+                                       logger.log(Level.WARNING, "Failed to execute fileshare command.\n" + e.getMessage());
                                }
-                               logger.log(Level.WARNING, "Failed to execute fileshare command.\n" + e.getMessage());
-                       }
                        
                        /* start net share */
-                       List<String> cmd3 = new ArrayList<String>();
-                       cmd3.add("net");
-                       cmd3.add("share");
-                       cmd3.add("emulator-" + portNo + "=" + fileshare);
-                       cmd3.add("/grant:"+ System.getProperty("user.name") + ",full");
-                       logger.log(Level.INFO, cmd3.toString());
-                       ProcessBuilder pb3 = new ProcessBuilder(cmd3);
-                       try {
-                               pb3.start();
-                       } catch (IOException e) {
-                               if (isConsole) {
-                                       new MessageDialog().openWarningDialog("Failed to execute fileshare command.\n" + e.getMessage());
+                               List<String> cmd3 = new ArrayList<String>();
+                               cmd3.add("net");
+                               cmd3.add("share");
+                               cmd3.add("emulator-" + portNo + "=" + fileshare);
+                               cmd3.add("/grant:"+ System.getProperty("user.name") + ",full");
+                               logger.log(Level.INFO, cmd3.toString());
+                               ProcessBuilder pb3 = new ProcessBuilder(cmd3);
+                               try {
+                                       pb3.start();
+                               } catch (IOException e) {
+                                       if (isConsole) {
+                                               new MessageDialog().openWarningDialog("Failed to execute fileshare command.\n" + e.getMessage());
+                                       }
+                                       logger.log(Level.WARNING, "Failed to execute fileshare command.\n" + e.getMessage());
                                }
-                               logger.log(Level.WARNING, "Failed to execute fileshare command.\n" + e.getMessage());
                        }
-               }
-               cmd.add("-serial");
-               cmd.add("file:" + EmulatorVMs.getInstance().getVMsConfigDirectory() + File.separator + property.getName() + File.separator + "logs" + File.separator + "emulator.klog");
-               cmd.add("-m");
-               cmd.add(String.valueOf(property.getConfiguration().getDevice().getRAM().getSize().getValue()));
-               cmd.add("-M");
-               cmd.add("maru-x86-machine");
-               cmd.add("-net");
-               cmd.add("nic,model=virtio,macaddr=" + macAddr);
-               cmd.add("-soundhw");
-               cmd.add("all");
-               cmd.add("-usb");
-               cmd.add("-usbdevice");
-               cmd.add("maru-touchscreen");
-               cmd.add("-vga");
-               cmd.add("maru");
-               cmd.add("-bios");
-               cmd.add("bios.bin");
-               cmd.add("-L");
-               cmd.add(fio.getBiosPath());
-               cmd.add("-kernel");
-               cmd.add(fio.getKernelPath() + File.separator+ "bzImage." + property.getArch().toString());
-               cmd.add("-net");
-               cmd.add("user");
-               cmd.add("-rtc");
-               cmd.add("base=utc");
-               if (property.getConfiguration().getBaseInformation().getDiskImage().getSwapDiskImage() != null) {
+                       cmd.add("-serial");
+                       cmd.add("file:" + EmulatorVMs.getInstance().getVMsConfigDirectory() + File.separator + property.getName() + File.separator + "logs" + File.separator + "emulator.klog");
+                       cmd.add("-m");
+                       cmd.add(String.valueOf(property.getConfiguration().getDevice().getRAM().getSize().getValue()));
+                       cmd.add("-M");
+                       cmd.add("maru-x86-machine");
+                       cmd.add("-net");
+                       cmd.add("nic,model=virtio,macaddr=" + macAddr);
+                       cmd.add("-soundhw");
+                       cmd.add("all");
+                       cmd.add("-usb");
+                       cmd.add("-usbdevice");
+                       cmd.add("maru-touchscreen");
+                       cmd.add("-vga");
+                       cmd.add("maru");
+                       cmd.add("-bios");
+                       cmd.add("bios.bin");
+                       cmd.add("-L");
+                       cmd.add(fio.getBiosPath());
+                       cmd.add("-kernel");
+                       cmd.add(fio.getKernelPath() + File.separator+ "bzImage." + property.getArch().toString());
+                       cmd.add("-net");
+                       cmd.add("user");
+                       cmd.add("-rtc");
+                       cmd.add("base=utc");
+                       if (property.getConfiguration().getBaseInformation().getDiskImage().getSwapDiskImage() != null) {
+                               cmd.add("-drive");
+                               cmd.add("file=" + property.getConfiguration().getBaseInformation().getDiskImage().getSwapDiskImage().getValue() + ",if=virtio,index=2");
+                       }
+               } else {    // ARM part of cmd
+                       if (path == null || path.isEmpty()) {
+                               cmd.add(fio.getBinPath() + File.separator + binary);
+                       } else {
+                               this.binPath = path;
+                               cmd.add(binPath + File.separator + binary);
+                       }
+
+                       cmd.add("--skin-args");
+                       cmd.add("width=" + width);
+                       cmd.add("height=" + height);
+                       if (skinPath != null) {
+                               cmd.add("skin.path=" + skinPath);
+                       }
+                       cmd.add("--qemu-args");
                        cmd.add("-drive");
-                       cmd.add("file=" + property.getConfiguration().getBaseInformation().getDiskImage().getSwapDiskImage().getValue() + ",if=virtio,index=2");
+                       //cmd.add("file=" + EmulatorVMs.getInstance().getVMsBaseDirectory() + File.separator + property.getArch().toString() + File.separator + property.getName() + File.separator +"emulimg-" + property.getName() + ".x86,if=virtio");
+                       cmd.add("file=" + property.getConfiguration().getBaseInformation().getDiskImage().getCurrentDiskImage().getValue()+ ",id=virtio-blk");
+                       cmd.add( "-device");
+                       cmd.add("virtio-blk,drive=virtio-blk");
+                       cmd.add("-netdev");
+                       cmd.add("user,id=virtio-net");
+                       cmd.add("-device");
+                       cmd.add("virtio-net,netdev=virtio-net");
+                       cmd.add("-append");
+                       cmd.add("console=ttySAC2,115200 video=s3cfb:"
+                                       + width
+                                       + "x"
+                                       + height
+                                       + "-24"
+                                       + " dpi=" + property.getConfiguration().getDevice().getDisplay().getDensity().getValue() * 10
+                                       + " rootwait root=/dev/vda rw rootfstype=ext4"
+                                       + " ip=10.0.2.16::10.0.2.2:255.255.255.0::eth0:none 5"
+                                       + " virtio_mmio.device=4K@0x10AD0000:423 virtio_mmio.device=4K@0x10AC0000:422");
+                       cmd.add("-serial");
+                       cmd.add(isLinux > -1 ? "/dev/null" : "none");
+                       cmd.add("-serial");
+                       cmd.add(isLinux > -1 ? "/dev/null" : "none");
+                       cmd.add("-serial");
+                       cmd.add("file:" + EmulatorVMs.getInstance().getVMsConfigDirectory() + File.separator + property.getName() + File.separator + "logs" + File.separator + "emulator.klog");
+                       cmd.add("-m");
+                       cmd.add(String.valueOf(property.getConfiguration().getDevice().getRAM().getSize().getValue()));
+                       cmd.add("-M");
+                       cmd.add("maru-arm-machine");
+                       cmd.add("-soundhw");
+                       cmd.add("all");
+                       cmd.add("-usb");
+                       cmd.add("-usbdevice");
+                       cmd.add("maru-touchscreen");
+                       cmd.add("-kernel");
+                       cmd.add(fio.getKernelPath() + File.separator+ "bzImage." + property.getArch().toString());
                }
 
                /* append HW virtualization option if supports */
index d032245..47ac69f 100644 (file)
@@ -36,7 +36,6 @@ import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
-import org.tizen.emulator.manager.vms.VMsProperty.Architecture;
 
 public class VMCreateHelper {
        public boolean checkString(String t) {
@@ -55,11 +54,6 @@ public class VMCreateHelper {
        }
 
        public boolean checkDupulicateName(String t) {
-               // TODO: default x86
-               return checkDupulicateName(t, Architecture.x86.toString());
-       }
-
-       public boolean checkDupulicateName(String t, String arc) {
                boolean isWindows = false;
                if (System.getProperty("os.name").toLowerCase().indexOf("windows") > -1) {
                        isWindows = true;
@@ -67,9 +61,6 @@ public class VMCreateHelper {
                }
                VMsProperty[] properties = (VMsProperty[])EmulatorVMs.getInstance().getProperties();
                for (VMsProperty p : properties) {
-                       if (p.getArch().toString() !=  arc) {
-                               continue;
-                       }
                        if (isWindows ) {
                                if (p.getName().toLowerCase().equals(t)) {
                                        return true;
index cee64dc..888f12d 100644 (file)
@@ -130,6 +130,7 @@ public class VMPropertyValue implements Cloneable {
 
                dest.resolution         = this.resolution;
                dest.dpi                        = this.dpi;
+               dest.skin                       = this.skin;
                dest.skinPath           = this.skinPath;
                dest.keyType            = this.keyType;
 
@@ -281,10 +282,10 @@ public class VMPropertyValue implements Cloneable {
 
        private void settingDefault(boolean isStandard, VMsProperty template) {
                vmsName                         = "";
-               archType                        = "x86"; // TODO
+               archType = isStandard ? template.getArch().toString() : "x86";
 
                baseImagePath           = "";
-               baseImagePathName   = isStandard ? "( emulimg-1.0.x86 )" : " ( None )";
+               baseImagePathName   = isStandard ? (archType.equals("x86") ? "( emulimg-2.0.x86 )" : "( emulimg-2.0.arm )") : " ( None )";
 
                settingConfigure(template);
        }
index 8035b89..be45eb5 100644 (file)
@@ -239,6 +239,7 @@ public class VMsWorker {
        }
 
        public void cloneVM(String newVMName) throws VMsWorkerException {
+               EmulatorVMs.getInstance().CustomArch = property.getArch().toString();
                VMPropertyValue newValue = property.getPropertyValue();
                newValue.vmsName = newVMName;
                // TODO
@@ -257,7 +258,7 @@ public class VMsWorker {
                }
                Logger logger = EMLogger.getLogger();
                boolean result = false;
-               MessageDialog msg = new MessageDialog(new Shell(Display.getCurrent()));
+
                int isLinux = System.getProperty("os.name").toLowerCase().indexOf("linux");
                int isWindows = System.getProperty("os.name").toLowerCase().indexOf("windows");
                int isMac = System.getProperty("os.name").toLowerCase().indexOf("mac");
@@ -328,8 +329,12 @@ public class VMsWorker {
                        return result;                                                   
                } catch (Exception err) {
                        logger.log(Level.SEVERE, err.getMessage());
-                       msg.openWarningDialog("Error occured while checking if the same VM .\n" +
-                                                                                                                                               err.getMessage());
+                       if (!EmulatorManager.isConsoleMode()) {
+                               MessageDialog msg = new MessageDialog(new Shell(Display.getCurrent()));
+                               msg.openWarningDialog("Error occured while checking if the same VM .\n" +
+                                               err.getMessage());
+                       }
+
                        return false;
                } finally {
                        // clear;