// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.07.03 at 02:07:17 PM KST
+// Generated on: 2012.07.10 at 09:39:08 AM KST
//
* <sequence>
* <element name="baseDiskImage" type="{http://www.tizen.org/em}diskImageFormatType"/>
* <element name="currentDiskImage" type="{http://www.tizen.org/em}diskImageFormatType"/>
+ * <element name="swapDiskImage" type="{http://www.tizen.org/em}diskImageFormatType"/>
* </sequence>
* <attribute name="type" use="required">
* <simpleType>
* <sequence>
* <element name="baseDiskImage" type="{http://www.tizen.org/em}diskImageFormatType"/>
* <element name="currentDiskImage" type="{http://www.tizen.org/em}diskImageFormatType"/>
+ * <element name="swapDiskImage" type="{http://www.tizen.org/em}diskImageFormatType"/>
* </sequence>
* <attribute name="type" use="required">
* <simpleType>
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"baseDiskImage",
- "currentDiskImage"
+ "currentDiskImage",
+ "swapDiskImage"
})
public static class DiskImage {
protected DiskImageFormatType baseDiskImage;
@XmlElement(required = true)
protected DiskImageFormatType currentDiskImage;
+ @XmlElement(required = true)
+ protected DiskImageFormatType swapDiskImage;
@XmlAttribute(required = true)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
protected String type;
}
/**
+ * Gets the value of the swapDiskImage property.
+ *
+ * @return
+ * possible object is
+ * {@link DiskImageFormatType }
+ *
+ */
+ public DiskImageFormatType getSwapDiskImage() {
+ return swapDiskImage;
+ }
+
+ /**
+ * Sets the value of the swapDiskImage property.
+ *
+ * @param value
+ * allowed object is
+ * {@link DiskImageFormatType }
+ *
+ */
+ public void setSwapDiskImage(DiskImageFormatType value) {
+ this.swapDiskImage = value;
+ }
+
+ /**
* Gets the value of the type property.
*
* @return
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.07.03 at 02:07:17 PM KST
+// Generated on: 2012.07.10 at 09:39:08 AM KST
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.07.03 at 02:07:17 PM KST
+// Generated on: 2012.07.10 at 09:39:08 AM KST
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.07.03 at 02:07:17 PM KST
+// Generated on: 2012.07.10 at 09:39:08 AM KST
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.07.03 at 02:07:17 PM KST
+// Generated on: 2012.07.10 at 09:39:08 AM KST
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.07.03 at 02:07:17 PM KST
+// Generated on: 2012.07.10 at 09:39:08 AM KST
//
}
/**
- * Create an instance of {@link EmulatorConfiguration }
+ * Create an instance of {@link DisplayType.Density }
*
*/
- public EmulatorConfiguration createEmulatorConfiguration() {
- return new EmulatorConfiguration();
+ public DisplayType.Density createDisplayTypeDensity() {
+ return new DisplayType.Density();
}
/**
}
/**
- * Create an instance of {@link TouchType }
+ * Create an instance of {@link DisplayType.SkinPath }
*
*/
- public TouchType createTouchType() {
- return new TouchType();
+ public DisplayType.SkinPath createDisplayTypeSkinPath() {
+ return new DisplayType.SkinPath();
}
/**
- * Create an instance of {@link SkinType }
+ * Create an instance of {@link DisplayType }
*
*/
- public SkinType createSkinType() {
- return new SkinType();
+ public DisplayType createDisplayType() {
+ return new DisplayType();
}
/**
- * Create an instance of {@link DeviceType }
+ * Create an instance of {@link UsabilityType }
*
*/
- public DeviceType createDeviceType() {
- return new DeviceType();
+ public UsabilityType createUsabilityType() {
+ return new UsabilityType();
}
/**
- * Create an instance of {@link BaseInformationType.DiskImage }
+ * Create an instance of {@link DeviceType }
*
*/
- public BaseInformationType.DiskImage createBaseInformationTypeDiskImage() {
- return new BaseInformationType.DiskImage();
+ public DeviceType createDeviceType() {
+ return new DeviceType();
}
/**
- * Create an instance of {@link DisplayType.Density }
+ * Create an instance of {@link RamType.Size }
*
*/
- public DisplayType.Density createDisplayTypeDensity() {
- return new DisplayType.Density();
+ public RamType.Size createRamTypeSize() {
+ return new RamType.Size();
}
/**
- * Create an instance of {@link UsabilityType.Logging }
+ * Create an instance of {@link DisplayType.Resolution }
*
*/
- public UsabilityType.Logging createUsabilityTypeLogging() {
- return new UsabilityType.Logging();
+ public DisplayType.Resolution createDisplayTypeResolution() {
+ return new DisplayType.Resolution();
}
/**
- * Create an instance of {@link UsabilityType }
+ * Create an instance of {@link SkinType }
*
*/
- public UsabilityType createUsabilityType() {
- return new UsabilityType();
+ public SkinType createSkinType() {
+ return new SkinType();
}
/**
- * Create an instance of {@link DisplayType.Resolution }
+ * Create an instance of {@link UsabilityType.Logging }
*
*/
- public DisplayType.Resolution createDisplayTypeResolution() {
- return new DisplayType.Resolution();
+ public UsabilityType.Logging createUsabilityTypeLogging() {
+ return new UsabilityType.Logging();
}
/**
- * Create an instance of {@link RamType.Size }
+ * Create an instance of {@link BaseInformationType.DiskImage }
*
*/
- public RamType.Size createRamTypeSize() {
- return new RamType.Size();
+ public BaseInformationType.DiskImage createBaseInformationTypeDiskImage() {
+ return new BaseInformationType.DiskImage();
}
/**
- * Create an instance of {@link RamType }
+ * Create an instance of {@link UsabilityType.FileSharing }
*
*/
- public RamType createRamType() {
- return new RamType();
+ public UsabilityType.FileSharing createUsabilityTypeFileSharing() {
+ return new UsabilityType.FileSharing();
}
/**
- * Create an instance of {@link DisplayType }
+ * Create an instance of {@link DiskImageFormatType }
*
*/
- public DisplayType createDisplayType() {
- return new DisplayType();
+ public DiskImageFormatType createDiskImageFormatType() {
+ return new DiskImageFormatType();
}
/**
- * Create an instance of {@link DiskImageFormatType }
+ * Create an instance of {@link RamType }
*
*/
- public DiskImageFormatType createDiskImageFormatType() {
- return new DiskImageFormatType();
+ public RamType createRamType() {
+ return new RamType();
}
/**
- * Create an instance of {@link UsabilityType.FileSharing }
+ * Create an instance of {@link EmulatorConfiguration }
*
*/
- public UsabilityType.FileSharing createUsabilityTypeFileSharing() {
- return new UsabilityType.FileSharing();
+ public EmulatorConfiguration createEmulatorConfiguration() {
+ return new EmulatorConfiguration();
}
/**
- * Create an instance of {@link DisplayType.SkinPath }
+ * Create an instance of {@link TouchType }
*
*/
- public DisplayType.SkinPath createDisplayTypeSkinPath() {
- return new DisplayType.SkinPath();
+ public TouchType createTouchType() {
+ return new TouchType();
}
}
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.07.03 at 02:07:17 PM KST
+// Generated on: 2012.07.10 at 09:39:08 AM KST
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.07.03 at 02:07:17 PM KST
+// Generated on: 2012.07.10 at 09:39:08 AM KST
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.07.03 at 02:07:17 PM KST
+// Generated on: 2012.07.10 at 09:39:08 AM KST
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.07.03 at 02:07:17 PM KST
+// Generated on: 2012.07.10 at 09:39:08 AM KST
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.07.03 at 02:07:17 PM KST
+// Generated on: 2012.07.10 at 09:39:08 AM KST
//
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.tizen.org/em", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
Package: emulator-manager
-Version: 1.0.67
+Version: 1.0.69
OS: linux
Build-host-os: linux
Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
Description: Tizen Emulator Manager
Package: emulator-manager
-Version: 1.0.67
+Version: 1.0.69
OS: windows
Build-host-os: windows
Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
import org.tizen.emulator.manager.logging.EMLogger;
import org.tizen.emulator.manager.tool.CheckSDCard;
import org.tizen.emulator.manager.tool.CheckVirtualization;
-import org.tizen.emulator.manager.tool.FileIO;
+import org.tizen.emulator.manager.tool.FilePath;
import org.tizen.emulator.manager.tool.SelectWorkspace;
import org.tizen.emulator.manager.ui.MainDialog;
import org.tizen.emulator.manager.ui.MessageDialog;
EMLogger.getInstance().initConsoleLogger();
try {
- FileLock lock = new RandomAccessFile(new File(FileIO.getInstance().getBinPath()
+ FileLock lock = new RandomAccessFile(new File(FilePath.getInstance().getBinPath()
+ File.separator + "." +System.getProperty("user.name"))+ ".lock",
"rw").getChannel().tryLock();
if (lock == null) {
EMLogger.getInstance().initLogger();
MessageDialog msg = new MessageDialog(new Shell(Display.getCurrent()));
try {
- FileLock lock = new RandomAccessFile(new File(FileIO.getInstance().getBinPath()
+ FileLock lock = new RandomAccessFile(new File(FilePath.getInstance().getBinPath()
+ File.separator + "." +System.getProperty("user.name"))+ ".lock",
"rw").getChannel().tryLock();
if (lock == null) {
import java.util.logging.Logger;
import org.tizen.emulator.manager.logging.EMLogger;
-import org.tizen.emulator.manager.tool.FileIO;
+import org.tizen.emulator.manager.tool.FilePath;
import org.tizen.emulator.manager.tool.SelectWorkspace;
import org.tizen.emulator.manager.vms.RAM_SIZE;
import org.tizen.emulator.manager.vms.RESOLUTION;
class Detail extends Action {
public Detail() {
this.action = Actions.AC_DETAIL;
- this.description = "Display more information of selected 'Virtual Target'.";
+ this.description = "Display more information of selected 'Virtual Machine'.";
this.usage = "detail -n test";
commandList.add(new Command("n", Actions.OP_NAME,
- "Name of vertual target.\n" +
+ "Name of virtual machine.\n" +
" If you do not enter a name, emulator manager's information is printed.","", false, true));
}
" Get workspace : workspace -g");
commandList.add(new Command("s", Actions.OP_SET,
- "Set path of workspace.", FileIO.getInstance().getTizenVmsPath(),
+ "Set path of workspace.", FilePath.getInstance().getTizenVmsPath(),
false, true));
commandList.add(new Command("g", Actions.OP_GET,
- "Get current workspace path.", FileIO.getInstance().getTizenVmsPath(),
+ "Get current workspace path.", FilePath.getInstance().getTizenVmsPath(),
false, false));
}
if (isGet) {
System.out.println("Current Workspace : ");
- System.out.println(FileIO.getInstance().getTizenVmsPath());
+ System.out.println(FilePath.getInstance().getTizenVmsPath());
} else {
File f = null;
try {
commandList.add(new Command("p", Actions.OP_PATH,
"Setting path of emulator program.",
- FileIO.getInstance().getBinPath(), false, true));
+ FilePath.getInstance().getBinPath(), false, true));
commandList.add(new Command("t", Actions.OP_TEST,
"Print parameters of emulator without executing emulator.",
class CreateBaseImage extends Action {
public CreateBaseImage() {
this.action = Actions.AC_CREATE_IMAGE;
- this.description = "Create base target image using VM's child image.";
+ this.description = "Create base disk image using VM's child image.";
this.usage = "create-image -n test [options]";
commandList.add(new Command("n", Actions.OP_NAME,
"Name of VM to create base target image.","", true, true));
commandList.add(new Command("p", Actions.OP_PATH,
"Setting Location to generate base target image.",
- FileIO.getInstance().getTizenVmsPath(), false, true));
+ FilePath.getInstance().getTizenVmsPath(), false, true));
}
@Override
class Clone extends Action {
public Clone() {
this.action = Actions.AC_COLONE;
- this.description = "Clone new VM which has the same configurations ad you selected..";
+ this.description = "Create new VM which has the same configurations as you selected..";
this.usage = "clone -n test -t target";
commandList.add(new Command("n", Actions.OP_NAME,
import java.util.ArrayList;
import java.util.Properties;
-import org.tizen.emulator.manager.tool.FileIO;
+import org.tizen.emulator.manager.tool.FilePath;
import org.tizen.emulator.manager.tool.StringResource;
public class EmulatorImages {
// TODO : only one base image
BaseImage image = null;
int id = 1;
- String path = FileIO.getInstance().getEtcPath();
+ String path = FilePath.getInstance().getEtcPath();
File f = new File(path + File.separator + StringResource.IMAGE_INFO_FILENAME);
try {
if (f.exists()) {
String domain = prop.getProperty(StringResource.PRODUCT_DOMAIN, "Phone");
String cpu = prop.getProperty(StringResource.TARGET_CPU, "X86");
String release = prop.getProperty(StringResource.RELEASE_VERSION, "Not identified");
- image = new BaseImage(Integer.toString(id++), version, FileIO.getInstance().getBaseimgPath(),
+ image = new BaseImage(Integer.toString(id++), version, FilePath.getInstance().getBaseimgPath(),
domain, cpu, release);
}
} catch (FileNotFoundException e) {
// TODO
} finally {
if (image == null) {
- image = new BaseImage(Integer.toString(id++), "Standard", FileIO.getInstance().getBaseimgPath(),
+ image = new BaseImage(Integer.toString(id++), "Standard", FilePath.getInstance().getBaseimgPath(),
"Phone", "X86", "Not identified");
}
imageList.add(image);
import java.util.logging.LogRecord;
import java.util.logging.Logger;
-import org.tizen.emulator.manager.tool.FileIO;
+import org.tizen.emulator.manager.tool.FilePath;
public class EMLogger {
private static EMLogger instance;
File logFolder;
Handler logFileHandler;
try {
- logFolder = new File(FileIO.getInstance().getTizenVmsArchPath());
+ logFolder = new File(FilePath.getInstance().getTizenVmsArchPath());
if (!logFolder.exists()) {
logFolder.mkdirs();
}
}
public static void CheckSDCardDir() {
- File dir = new File(FileIO.getInstance().getTizenVmsPath()
+ File dir = new File(FilePath.getInstance().getTizenVmsPath()
+ File.separator + StringResource.SD_CARD_DIR);
if (!dir.exists()) {
File dest = null;
File src = null;
for (String s : StringResource.SD_CARD) {
- dest = new File(FileIO.getInstance().getTizenVmsPath()
+ dest = new File(FilePath.getInstance().getTizenVmsPath()
+ File.separator + StringResource.SD_CARD_DIR
+ File.separator + s);
if (!dest.exists()) {
- src = new File(FileIO.getInstance().getSDCardPath()
+ src = new File(FilePath.getInstance().getSDCardPath()
+ File.separator +s);
if (!src.exists()) {
EMLogger.getLogger().log(Level.WARNING,
int exitValue = 0;
List<String> cmd = new ArrayList<String>();
- cmd.add(FileIO.getInstance().getBinPath() + File.separator + "check-hax.exe");
+ cmd.add(FilePath.getInstance().getBinPath() + File.separator + "check-hax.exe");
ProcessBuilder pb = new ProcessBuilder(cmd);
- pb.directory(new File(FileIO.getInstance().getBinPath()));
+ pb.directory(new File(FilePath.getInstance().getBinPath()));
try {
Process process = null;
import org.tizen.emulator.manager.EmulatorManager;
import org.tizen.emulator.manager.vms.EmulatorVMs;
-public class FileIO {
+public class FilePath {
private final static String arch_suffix = File.separator +"x86";
private final static String icon_suffix = File.separator +"skins"+ File.separator +"icons" + File.separator +"vtm.ico";
private final static String data_suffix = File.separator +"data";
private static String biosPath;
private static String skinPath;
private static String sdcardPath;
+ private static String swapPath;
private static String vmsPath;
private static String vmsArchPath;
confPath = arcPath + conf_suffix;
baseImagePath = arcPath + baseimg_suffix;
sdcardPath = dataPath + File.separator + "sdcard";
+ swapPath = dataPath + File.separator + "swap";
x86KernelPath = dataPath + x86_kernel_suffix;
biosPath = dataPath + bios_suffix;
}
- static FileIO instance = null;
+ static FilePath instance = null;
static {
- synchronized(FileIO.class) {
- instance = new FileIO();
+ synchronized(FilePath.class) {
+ instance = new FilePath();
}
}
- private FileIO() {
+ private FilePath() {
}
- public static FileIO getInstance() {
+ public static FilePath getInstance() {
return instance;
}
public String getSDCardPath() {
return sdcardPath;
}
+
+ public String getSwapPath() {
+ return swapPath;
+ }
}
}
EmulatorVMs.getInstance().setVMsBaseDirectory(workspacePath);
- FileIO.setVMSPath();
+ FilePath.setVMSPath();
}
return true;
}
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Shell;
-import org.tizen.emulator.manager.tool.FileIO;
+import org.tizen.emulator.manager.tool.FilePath;
import org.tizen.emulator.manager.ui.vmstree.VMsTree;
import org.tizen.emulator.manager.vms.VMsProperty;
import org.tizen.emulator.manager.vms.VMsWorkerException;
fd.setFilterExtensions(filter);
fd.setFilterNames(filterName);
fd.setFileName("emulimg-" + property.getName());
- fd.setFilterPath(FileIO.getInstance().getTizenVmsPath());
+ fd.setFilterPath(FilePath.getInstance().getTizenVmsPath());
String path = null;
path = fd.open();
import java.util.List;
import org.tizen.emulator.manager.tool.About;
-import org.tizen.emulator.manager.tool.FileIO;
+import org.tizen.emulator.manager.tool.FilePath;
import org.tizen.emulator.manager.vms.VMsProperty.Architecture;
import org.tizen.emulator.manager.vms.xml.DisplayType.Resolution;
import org.tizen.emulator.manager.vms.xml.EmulatorConfiguration;
this.property = EmulatorVMs.getInstance().getNewProperty(newVM.imageName, Architecture.x86);
this.newVM = newVM;
- this.folder = new File(FileIO.getInstance().getVirtualTargetPath(newVM.imageName));
+ this.folder = new File(FilePath.getInstance().getVirtualTargetPath(newVM.imageName));
}
public VMsProperty createInternal() throws VMsWorkerException {
throw e;
}
- File log = new File(FileIO.getInstance().getVirtualTargetLogPath(newVM.imageName));
+ File log = new File(FilePath.getInstance().getVirtualTargetLogPath(newVM.imageName));
log.mkdir();
settingProperty();
}
}
+ private String customPath = null;
+ private String swapPath = null;
private void createDiskImage() throws VMsCreatorException {
if (newVM.baseImagePath != null && !newVM.baseImagePath.isEmpty()) {
checkCustomBaseImage(newVM.baseImagePath);
} else {
- newVM.baseImagePath = FileIO.getInstance().getBaseimgPath();
+ newVM.baseImagePath = FilePath.getInstance().getBaseimgPath();
}
if (!new File(newVM.baseImagePath).exists()) {
throw new VMsCreatorException("Base image does not exist.");
}
- String targetPath = folder.getAbsolutePath() + File.separator + "emulimg-" +
+ customPath = folder.getAbsolutePath() + File.separator + "emulimg-" +
newVM.imageName + "." + Architecture.x86.toString();
- createInitialVMImageInternal(newVM.baseImagePath, targetPath);
+ createInitialVMImageInternal(newVM.baseImagePath, customPath);
+ createSwapImageInternal();
+ }
+
+ private void createSwapImageInternal() throws VMsCreatorException {
+ String exe_path = FilePath.getInstance().getBinPath() + File.separator + "qemu-img";
+ String swap_base_path = FilePath.getInstance().getSwapPath() + File.separator + "swap.img";
+ if (!new File(swap_base_path).exists()) {
+ return;
+ }
+ swapPath = folder.getAbsolutePath() + File.separator
+ + "swap-"+ newVM.imageName + "." + "img";
+ List<String> cmd = new ArrayList<String>();
+ cmd.add(exe_path);
+ cmd.add("create");
+ cmd.add("-b");
+ cmd.add(swap_base_path);
+ cmd.add("-f");
+ cmd.add("qcow2");
+ cmd.add(swapPath);
+
+ if (!new QemuImgProc(cmd).Running()) {
+ throw new VMsCreatorException("Failed to create the VM because of failed qemu-img processing.\n"
+ + "You can get more information in log file ("
+ + FilePath.getInstance().getTizenVmsArchPath() + File.separator + "emulator-manager)");
+ }
}
private void checkCustomBaseImage(final String path) throws VMsCreatorException {
- String exe_path = FileIO.getInstance().getBinPath() + File.separator + "qemu-img";
+ String exe_path = FilePath.getInstance().getBinPath() + File.separator + "qemu-img";
List<String> cmd = new ArrayList<String>();
cmd.add(exe_path);
}
public void createInitialVMImageInternal(String baseImagePath, String targetImagePath) throws VMsCreatorException {
- String exe_path = FileIO.getInstance().getBinPath() + File.separator + "qemu-img";
+ String exe_path = FilePath.getInstance().getBinPath() + File.separator + "qemu-img";
List<String> cmd = new ArrayList<String>();
cmd.add(exe_path);
if (!new QemuImgProc(cmd).Running()) {
throw new VMsCreatorException("Failed to create the VM because of failed qemu-img processing.\n"
+ "You can get more information in log file ("
- + FileIO.getInstance().getTizenVmsArchPath() + File.separator + "emulator-manager)");
+ + FilePath.getInstance().getTizenVmsArchPath() + File.separator + "emulator-manager)");
}
}
// TODO
if (newVM.keyType == 1) { // 1key
- newVM.skinPath = FileIO.getInstance().getSkinPath() + File.separator + "emul_" + newVM.resolution;
+ newVM.skinPath = FilePath.getInstance().getSkinPath() + File.separator + "emul_" + newVM.resolution;
} else if (newVM.keyType == 3){ // 3 key
- newVM.skinPath = FileIO.getInstance().getSkinPath() + File.separator + "emul_3keys_" + newVM.resolution;
+ newVM.skinPath = FilePath.getInstance().getSkinPath() + File.separator + "emul_3keys_" + newVM.resolution;
}
}
//
ec.getBaseInformation().getDiskImage().setBaseDiskImage(factory.createDiskImageFormatType());
ec.getBaseInformation().getDiskImage().setCurrentDiskImage(factory.createDiskImageFormatType());
-
// TODO :
ec.getBaseInformation().getDiskImage().getBaseDiskImage().setFormat("qcow2");
ec.getBaseInformation().getDiskImage().getBaseDiskImage().setValue(newVM.baseImagePath);
ec.getBaseInformation().getDiskImage().getCurrentDiskImage().setFormat("qcow2");
- ec.getBaseInformation().getDiskImage().getCurrentDiskImage().setValue(
- folder.getAbsolutePath() + File.separator + "emulimg-" + newVM.imageName + "." + Architecture.x86.toString());
+ //ec.getBaseInformation().getDiskImage().getCurrentDiskImage().setValue(
+ // folder.getAbsolutePath() + File.separator + "emulimg-" + newVM.imageName + "." + Architecture.x86.toString());
+ ec.getBaseInformation().getDiskImage().getCurrentDiskImage().setValue(customPath);
+
+ if (swapPath != null) {
+ ec.getBaseInformation().getDiskImage().setSwapDiskImage(factory.createDiskImageFormatType());
+ ec.getBaseInformation().getDiskImage().getSwapDiskImage().setFormat("qcow2");
+ ec.getBaseInformation().getDiskImage().getSwapDiskImage().setValue(swapPath);
+ }
ec.getUsability().setLogging(factory.createUsabilityTypeLogging());
ec.getUsability().getLogging().setLevel("NONE");
import org.tizen.emulator.manager.EmulatorManager;
import org.tizen.emulator.manager.logging.EMLogger;
import org.tizen.emulator.manager.tool.CheckVirtualization;
-import org.tizen.emulator.manager.tool.FileIO;
+import org.tizen.emulator.manager.tool.FilePath;
import org.tizen.emulator.manager.tool.PortHelper;
import org.tizen.emulator.manager.tool.SelectWorkspace;
import org.tizen.emulator.manager.ui.MessageDialog;
logger.log(Level.INFO, String.format("MAC set as default = %s", macAddr));
}
- FileIO fio = FileIO.getInstance();
+ FilePath fio = FilePath.getInstance();
if (path == null || path.isEmpty()) {
cmd.add(fio.getBinPath() + File.separator + binary);
} else {
}
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=" + 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");
cmd.add( "-boot");
cmd.add("c");
cmd.add("-append");
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");
+ }
+
/* append HW virtualization option if supports */
if (hwVirtualization != null) {
cmd.add(hwVirtualization);
}
public boolean launch(List<String> cmd) {
- FileIO fio = FileIO.getInstance();
+ FilePath fio = FilePath.getInstance();
ProcessBuilder pb = new ProcessBuilder(cmd);
if (this.binPath == null || this.binPath.isEmpty()) {
import java.io.File;
-import org.tizen.emulator.manager.tool.FileIO;
+import org.tizen.emulator.manager.tool.FilePath;
import org.tizen.emulator.manager.vms.xml.EmulatorConfiguration;
import org.tizen.emulator.manager.vms.xml.TouchType;
property.getConfiguration().getDevice().getDisplay().setResolution(oldVM.resolutionType);
if (newVM.keyType == 1) { // 1key
- newVM.skinPath = FileIO.getInstance().getSkinPath() + File.separator + "emul_" + newVM.resolution;
+ newVM.skinPath = FilePath.getInstance().getSkinPath() + File.separator + "emul_" + newVM.resolution;
} else if (newVM.keyType == 3){ // 3 key
- newVM.skinPath = FileIO.getInstance().getSkinPath() + File.separator + "emul_3keys_" + newVM.resolution;
+ newVM.skinPath = FilePath.getInstance().getSkinPath() + File.separator + "emul_3keys_" + newVM.resolution;
}
property.getConfiguration().getDevice().getDisplay().getSkinPath().setPath(newVM.skinPath);
// TODO
if (newVM.keyType != oldVM.keyType) {
if (newVM.keyType == 1) { // 1key
- newVM.skinPath = FileIO.getInstance().getSkinPath() + File.separator + "emul_" + newVM.resolution;
+ newVM.skinPath = FilePath.getInstance().getSkinPath() + File.separator + "emul_" + newVM.resolution;
} else if (newVM.keyType == 3){ // 3 key
- newVM.skinPath = FileIO.getInstance().getSkinPath() + File.separator + "emul_3keys_" + newVM.resolution;
+ newVM.skinPath = FilePath.getInstance().getSkinPath() + File.separator + "emul_3keys_" + newVM.resolution;
}
property.getConfiguration().getDevice().getDisplay().getSkinPath().setPath(newVM.skinPath);
}
import java.util.logging.Level;
import org.tizen.emulator.manager.logging.EMLogger;
-import org.tizen.emulator.manager.tool.FileIO;
+import org.tizen.emulator.manager.tool.FilePath;
public class QemuImgProc {
private List<String> cmd = null;
"Error while running 'qemu-img'. Exit value : " + process.exitValue());
errorMsg = "Error while running 'qemu-img'. Exit value : " + process.exitValue() +
"\nYou can get more information in log file ("
- + FileIO.getInstance().getTizenVmsArchPath() + File.separator + "emulator-manager)";
+ + FilePath.getInstance().getTizenVmsArchPath() + File.separator + "emulator-manager)";
}
} catch (InterruptedException e) {
isError = true;
}
return errorMsg;
}
+
public boolean Running() {
assert cmd == null;
import java.io.File;
-import org.tizen.emulator.manager.tool.FileIO;
+import org.tizen.emulator.manager.tool.FilePath;
import org.tizen.emulator.manager.tool.StringResource;
import org.tizen.emulator.manager.vms.xml.DisplayType.Resolution;
import org.tizen.emulator.manager.vms.xml.TouchType;
value.resolution = RESOLUTION.HD.toString();
value.dpi = RESOLUTION.HD.getDPI(); // this value be related to resolution
// TODO : Skin Path
- value.skinPath = FileIO.getInstance().getSkinPath() + File.separator + "emul_" + value.resolution;
+ value.skinPath = FilePath.getInstance().getSkinPath() + File.separator + "emul_" + value.resolution;
value.keyType = 1;
//
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.tizen.emulator.manager.logging.EMLogger;
-import org.tizen.emulator.manager.tool.FileIO;
+import org.tizen.emulator.manager.tool.FilePath;
import org.tizen.emulator.manager.ui.MessageDialog;
throw new VMsWorkerException("Failed to create base image!\nFile does not exist :" + childImage);
}
- String exe_path = FileIO.getInstance().getBinPath() + File.separator + "qemu-img";
+ String exe_path = FilePath.getInstance().getBinPath() + File.separator + "qemu-img";
List<String> cmd = new ArrayList<String>();
cmd.add(exe_path);
if (worker.isError()) {
throw new VMsWorkerException("Failed to create new base image becauese of failed qemu-img processing!\n"
+ "You can get more information in log file ("
- + FileIO.getInstance().getTizenVmsArchPath() + File.separator + "emulator-manager)");
+ + FilePath.getInstance().getTizenVmsArchPath() + File.separator + "emulator-manager)");
}
}
}
BufferedReader stdOut = new BufferedReader(new InputStreamReader(p.getInputStream()));
if(isLinux > -1) {
while ((line = stdOut.readLine()) != null) {
- String imagePath = FileIO.getInstance().getVirtualTargetImagePath(property.getName());
+ String imagePath = FilePath.getInstance().getVirtualTargetImagePath(property.getName());
if(line.contains(imagePath)) {
//logger.log(Level.INFO, line + " contains " + imagePath);
logger.log(Level.INFO, "emulator instance with the same name is running now (" + imagePath + ")");
minOccurs="1" maxOccurs="1" />
<element name="currentDiskImage" type="em:diskImageFormatType"
minOccurs="1" maxOccurs="1" />
+ <element name="swapDiskImage" type="em:diskImageFormatType"
+ minOccurs="1" maxOccurs="1" />
</sequence>
<attribute name="type" use="required">
<simpleType>