From 1f7609e0b1fc2ca5fc7fd5e2bd470a8032beb797 Mon Sep 17 00:00:00 2001 From: jihye kim Date: Tue, 25 Sep 2012 15:38:01 +0900 Subject: [PATCH] [Title] emulator manager : modify source to support 'ARM' emulator. [Desc.] modify source to support 'ARM' emulator. [Issue] N/A --- .../emulator/manager/console/ConsoleCreateVM.java | 24 +- .../emulator/manager/console/ConsoleProcessor.java | 2 +- src/org/tizen/emulator/manager/ui/CloneDialog.java | 2 +- .../emulator/manager/ui/detail/TableWidget.java | 12 +- src/org/tizen/emulator/manager/vms/Creator.java | 11 +- .../tizen/emulator/manager/vms/EmulatorVMs.java | 2 + src/org/tizen/emulator/manager/vms/Launcher.java | 249 +++++++++++++-------- .../tizen/emulator/manager/vms/VMCreateHelper.java | 9 - .../emulator/manager/vms/VMPropertyValue.java | 5 +- src/org/tizen/emulator/manager/vms/VMsWorker.java | 11 +- 10 files changed, 202 insertions(+), 125 deletions(-) diff --git a/src/org/tizen/emulator/manager/console/ConsoleCreateVM.java b/src/org/tizen/emulator/manager/console/ConsoleCreateVM.java index 87b57bf..7dc1d1f 100644 --- a/src/org/tizen/emulator/manager/console/ConsoleCreateVM.java +++ b/src/org/tizen/emulator/manager/console/ConsoleCreateVM.java @@ -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()); + } } } diff --git a/src/org/tizen/emulator/manager/console/ConsoleProcessor.java b/src/org/tizen/emulator/manager/console/ConsoleProcessor.java index a34d3db..f8368bd 100644 --- a/src/org/tizen/emulator/manager/console/ConsoleProcessor.java +++ b/src/org/tizen/emulator/manager/console/ConsoleProcessor.java @@ -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) { diff --git a/src/org/tizen/emulator/manager/ui/CloneDialog.java b/src/org/tizen/emulator/manager/ui/CloneDialog.java index 5a7ebb9..91d8d27 100644 --- a/src/org/tizen/emulator/manager/ui/CloneDialog.java +++ b/src/org/tizen/emulator/manager/ui/CloneDialog.java @@ -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; diff --git a/src/org/tizen/emulator/manager/ui/detail/TableWidget.java b/src/org/tizen/emulator/manager/ui/detail/TableWidget.java index 573ebdb..8f3f147 100644 --- a/src/org/tizen/emulator/manager/ui/detail/TableWidget.java +++ b/src/org/tizen/emulator/manager/ui/detail/TableWidget.java @@ -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(); diff --git a/src/org/tizen/emulator/manager/vms/Creator.java b/src/org/tizen/emulator/manager/vms/Creator.java index 94ceae4..90dae9b 100644 --- a/src/org/tizen/emulator/manager/vms/Creator.java +++ b/src/org/tizen/emulator/manager/vms/Creator.java @@ -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); } // diff --git a/src/org/tizen/emulator/manager/vms/EmulatorVMs.java b/src/org/tizen/emulator/manager/vms/EmulatorVMs.java index 8b964a2..955c35a 100644 --- a/src/org/tizen/emulator/manager/vms/EmulatorVMs.java +++ b/src/org/tizen/emulator/manager/vms/EmulatorVMs.java @@ -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") diff --git a/src/org/tizen/emulator/manager/vms/Launcher.java b/src/org/tizen/emulator/manager/vms/Launcher.java index a0fe07b..c453e02 100644 --- a/src/org/tizen/emulator/manager/vms/Launcher.java +++ b/src/org/tizen/emulator/manager/vms/Launcher.java @@ -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 cmd2 = new ArrayList(); 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 cmd3 = new ArrayList(); 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 cmd2 = new ArrayList(); - 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 cmd2 = new ArrayList(); + 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 cmd3 = new ArrayList(); - 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 cmd3 = new ArrayList(); + 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 */ diff --git a/src/org/tizen/emulator/manager/vms/VMCreateHelper.java b/src/org/tizen/emulator/manager/vms/VMCreateHelper.java index d032245..47ac69f 100644 --- a/src/org/tizen/emulator/manager/vms/VMCreateHelper.java +++ b/src/org/tizen/emulator/manager/vms/VMCreateHelper.java @@ -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; diff --git a/src/org/tizen/emulator/manager/vms/VMPropertyValue.java b/src/org/tizen/emulator/manager/vms/VMPropertyValue.java index cee64dc..888f12d 100644 --- a/src/org/tizen/emulator/manager/vms/VMPropertyValue.java +++ b/src/org/tizen/emulator/manager/vms/VMPropertyValue.java @@ -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); } diff --git a/src/org/tizen/emulator/manager/vms/VMsWorker.java b/src/org/tizen/emulator/manager/vms/VMsWorker.java index 8035b89..be45eb5 100644 --- a/src/org/tizen/emulator/manager/vms/VMsWorker.java +++ b/src/org/tizen/emulator/manager/vms/VMsWorker.java @@ -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; -- 2.7.4