job: VT checking routine is moved to job "CheckVT"
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Fri, 12 Jun 2015 04:37:50 +0000 (13:37 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Fri, 12 Jun 2015 08:30:33 +0000 (17:30 +0900)
Change-Id: I4ec50ece617f58c4572a021af266e3bc8280afd1
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
src/org/tizen/emulator/manager/EmulatorManager.java
src/org/tizen/emulator/manager/console/ActionList.java
src/org/tizen/emulator/manager/console/ConsoleCreateVM.java
src/org/tizen/emulator/manager/job/CheckVT.java
src/org/tizen/emulator/manager/tool/CheckVirtualization.java
src/org/tizen/emulator/manager/tool/TapUtil.java
src/org/tizen/emulator/manager/ui/detail/item/property/CPUSupportSubViewItem.java
src/org/tizen/emulator/manager/ui/detail/item/property/ProcessorViewItem.java
src/org/tizen/emulator/manager/vms/VMPropertyValue.java
src/org/tizen/emulator/manager/vms/option/HWSupportOption.java
src/org/tizen/emulator/manager/vms/option/ProcessorOption.java

index 2dee27d..a177e43 100755 (executable)
@@ -42,6 +42,7 @@ import org.eclipse.swt.widgets.Shell;
 //import org.tizen.emulator.manager.console.CommandLineParser;
 import org.tizen.emulator.manager.console.Action;
 import org.tizen.emulator.manager.console.CommandLineParser;
+import org.tizen.emulator.manager.job.CheckGPU;
 import org.tizen.emulator.manager.job.CheckSDCard;
 import org.tizen.emulator.manager.job.CheckVT;
 import org.tizen.emulator.manager.job.InitAboutContents;
@@ -305,7 +306,7 @@ public class EmulatorManager {
                }
 
                Overseer startupOverseer = Overseer.newOverseer("Start-up", InitAboutContents.class,
-                               CheckVT.class, CheckSDCard.class);
+                               CheckVT.class, CheckGPU.class, CheckSDCard.class);
                startupOverseer.startWork();
                // FIXME: we should not join overseer thread.
                // but now we are not ready for asynchronous actions.
index 3b44c5e..c25f3a1 100644 (file)
 
 package org.tizen.emulator.manager.console;
 
-import java.util.List;
 import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.emulator.manager.job.CheckVT;
 import org.tizen.emulator.manager.resources.FilePathResources;
 import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.tool.CheckVirtualization;
@@ -39,7 +41,7 @@ import org.tizen.emulator.manager.vms.RESOLUTION;
 
 public class ActionList {
        private Global globalAction = null;
-       private ArrayList<Action> actionList = new ArrayList<Action>();
+       private final ArrayList<Action> actionList = new ArrayList<Action>();
 
        public ArrayList<Action> getActionList() {
                return actionList;
@@ -150,6 +152,7 @@ class Global extends Action {
                                Actions.DESC_VERVOSE, "", false ,false));
        }
 
+       @Override
        public boolean process() {
                return true;
        }
@@ -397,7 +400,7 @@ class Create extends Action {
                                , RESOLUTION.HD.getType(), false, true));
                commandList.add(new Command("d", Actions.OP_DPI,
                                Actions.DESC_DPI, Integer.toString(RESOLUTION.HD.getDPI()), false, true));
-               
+
                /** TODO : resolution and skin..***********************************************/
                /*
                ArrayList<Skin> skinList = SkinList.getInstance().findSkinList(RESOLUTION.HD);
@@ -426,7 +429,7 @@ class Create extends Action {
                                Actions.DESC_FILESHAREPATH, "", false, true));
                commandList.add(new Command("v", Actions.OP_VIRTUALIZATION,
                                Actions.DESC_VIRTUALIZATION,
-                               CheckVirtualization.getInstance().isSupportVirtualization() ? "yes" : "no", false, true));
+                               CheckVT.isVTSupported() ? "yes" : "no", false, true));
                commandList.add(new Command("g", Actions.OP_GLACCELERATION,
                                Actions.DESC_GLACCELERATION,
                                CheckVirtualization.getInstance().isSupportGPU() ? "yes" : "no", false, true));
@@ -562,7 +565,7 @@ class Modify extends Action {
                                Actions.DESC_FILESHAREPATH, "", false, true));
                commandList.add(new Command("v", Actions.OP_VIRTUALIZATION,
                                Actions.DESC_VIRTUALIZATION,
-                               CheckVirtualization.getInstance().isSupportVirtualization() ? "yes" : "no", false, true));
+                               CheckVT.isVTSupported() ? "yes" : "no", false, true));
                commandList.add(new Command("g", Actions.OP_GLACCELERATION,
                                Actions.DESC_GLACCELERATION,
                                CheckVirtualization.getInstance().isSupportGPU() ? "yes" : "no", false, true));
@@ -821,7 +824,7 @@ class Delete extends Action {
                this.usage = "delete -n test";
 
                commandList.add(new Command("n", Actions.OP_NAME,
-                               "Name of VM to delete.","", true, true)); 
+                               "Name of VM to delete.","", true, true));
        }
 
        @Override
index 430a227..a5f2d02 100644 (file)
@@ -34,6 +34,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.tizen.emulator.manager.job.CheckVT;
 import org.tizen.emulator.manager.logging.EMLogger;
 import org.tizen.emulator.manager.platform.BaseImage;
 import org.tizen.emulator.manager.platform.Platform;
@@ -49,8 +50,8 @@ import org.tizen.emulator.manager.vms.RESOLUTION;
 import org.tizen.emulator.manager.vms.SKIN_TYPE;
 import org.tizen.emulator.manager.vms.VMProperty;
 import org.tizen.emulator.manager.vms.VMPropertyValue;
-import org.tizen.emulator.manager.vms.helper.VMWorkerException;
 import org.tizen.emulator.manager.vms.helper.HelperClass;
+import org.tizen.emulator.manager.vms.helper.VMWorkerException;
 
 public class ConsoleCreateVM {
 
@@ -322,7 +323,7 @@ public class ConsoleCreateVM {
 
                        if (!check) {
                                throw new ConsoleException("DPI value (" + c.getCurrentValue() + ") is not avaliable.");
-                       }       
+                       }
                }
                else if (c.getLongName() == Actions.OP_SKIN) {
                        skinCommand = c;
@@ -336,7 +337,7 @@ public class ConsoleCreateVM {
                                check = true;
                        }
                        if (!check) {
-                               throw new ConsoleException("This key type (" 
+                               throw new ConsoleException("This key type ("
                                                + c.getCurrentValue() + ") is not avaliable. Avaliable key type is 1 or 3.");
                        }
                }
@@ -478,7 +479,7 @@ public class ConsoleCreateVM {
                                System.out.println("So this value set false.");
                                return false;
                        }
-                       if (!CheckVirtualization.getInstance().isSupportVirtualization()) {
+                       if (!CheckVT.isVTSupported()) {
                                throw new ConsoleException("This computer does not support hardware virtualization.");
                        } else {
                                return true;
index 9efc5d9..b413eb3 100644 (file)
@@ -1,10 +1,71 @@
 package org.tizen.emulator.manager.job;
 
-import org.tizen.emulator.manager.tool.CheckVirtualization;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+
+import org.tizen.emulator.manager.EmulatorManager;
+import org.tizen.emulator.manager.logging.EMLogger;
+import org.tizen.emulator.manager.resources.FilePathResources;
+import org.tizen.emulator.manager.vms.helper.HelperClass;
+import org.tizen.emulator.manager.vms.helper.ProcessResult;
 
 public class CheckVT implements Job {
+       private static final String HAX_CHECKER;
+       private static final String ENABLE_HAX = "-enable-hax";
+       private static final String ENABLE_KVM = "-enable-kvm";
+
+       private static boolean isVTSupported = false;
+       private static boolean isNonUG = false; // for HAXM, non-UG CPU
+
+       static {
+               HAX_CHECKER = EmulatorManager.isWin() ? "check-hax.exe" : "check-hax";
+       }
+
+       public static String getVTEnablingCommand() {
+               if (EmulatorManager.isWin() || EmulatorManager.isMac()) {
+                       return ENABLE_HAX;
+               }
+
+               return ENABLE_KVM;
+       }
+
+       public static boolean isVTSupported() {
+               return isVTSupported;
+       }
+
+       // for HAXM
+       public static boolean isNonUG() {
+               return isNonUG;
+       }
+
        @Override
        public void work() {
-               CheckVirtualization.getInstance().check();
+               if (EmulatorManager.isWin() || EmulatorManager.isMac()) {
+                       List<String> cmd = new ArrayList<String>();
+                       cmd.add(FilePathResources.getEmulatorToolPath() + File.separator + HAX_CHECKER);
+                       ProcessResult result = HelperClass.runProcess(cmd,
+                                       new File(FilePathResources.getEmulatorToolPath()));
+
+                       switch (result.getExitValue()) {
+                       case 0:
+                               isVTSupported = true;
+                               break;
+                       case 1:
+                               isVTSupported = true;
+                               isNonUG = true;
+                               break;
+                       default:
+                               break;
+                       }
+               } else if (EmulatorManager.isLinux()) {
+                       if(new File("/dev/kvm").canRead()) {
+                               isVTSupported = true;
+                       }
+               }
+
+               EMLogger.getLogger().log(Level.INFO, "Support HW virtualization: "
+                               + Boolean.toString(isVTSupported));
        }
 }
index 0dea550..9e59b4d 100644 (file)
@@ -37,28 +37,17 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.logging.Level;
 
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
 import org.tizen.emulator.manager.logging.EMLogger;
 import org.tizen.emulator.manager.resources.FilePathResources;
-import org.tizen.emulator.manager.resources.StringResources;
 
 public class CheckVirtualization {
        private static CheckVirtualization instance     = new CheckVirtualization();
-       private static boolean isVirtualizationSupport  = true;
-       private static String virtualization_enable_command     = null;
-       private static String virtualization_disable_command    = null;
        private static boolean isGPUSupport = true;
        private static String GPU_enable_command        = null;
        private static String GPU_disable_command       = null;
 
        private static boolean isCheck = false;
        private static boolean isGallium = false; // for ubuntu OS
-       private static boolean isNonUG = false; // non-UG mode
 
        private CheckVirtualization() {
                // singleton class
@@ -68,10 +57,6 @@ public class CheckVirtualization {
                return instance;
        }
 
-       public boolean isSupportVirtualization() {
-               return isVirtualizationSupport;
-       }
-
        public boolean isSupportGPU() {
                return isGPUSupport;
        }
@@ -80,51 +65,13 @@ public class CheckVirtualization {
                return isGallium;
        }
 
-       public boolean isNonUG() {
-               return isNonUG;
-       }
-
-       public String getVirtualizationEnableCommnad() {
-               return virtualization_enable_command;
-       }
-
-       public String getVirtualizationDisableCommnad() {
-               return virtualization_disable_command;
-       }
-
        public void check() {
                if (!isCheck) {
-                       checkVirtualization();
                        checkGPU();
                        isCheck = true;
                }
        }
 
-       private void checkVirtualization() {
-               //CheckDialog dialog = new CheckDialog();
-               //dialog.create();
-               VirtualizationCheckWork work = new VirtualizationCheckWork();
-               work.setDaemon(true);
-               work.start();
-
-               //dialog.open();
-
-               try {
-                       work.join();
-               } catch (InterruptedException e) {
-                       // TODO Auto-generated catch block
-                       EMLogger.getLogger().log(Level.WARNING, "Exception" + e.getMessage());
-               }
-               /*
-               while(work.isAlive()) {
-                       if(!Display.getCurrent().readAndDispatch()) 
-                               Display.getCurrent().sleep();
-               }
-               */
-
-               //dialog.close();
-       }
-
        private void checkGPU() {
                GPUCheckWork work = new GPUCheckWork();
                work.setDaemon(true);
@@ -145,63 +92,8 @@ public class CheckVirtualization {
                return GPU_disable_command;
        }
 
-       private static class VirtualizationCheckWork extends Thread {
-               public void run() {
-                       if (System.getProperty("os.name").toLowerCase().indexOf("windows") > -1
-                                       || System.getProperty("os.name").toLowerCase().indexOf("mac") > -1) {
-                               int exitValue = 1;
-
-                               List<String> cmd = new ArrayList<String>();
-                               cmd.add(FilePathResources.getEmulatorToolPath() + File.separator +
-                                               (System.getProperty("os.name").toLowerCase().indexOf("windows") > -1 ? "check-hax.exe" : "check-hax"));
-                               ProcessBuilder pb = new ProcessBuilder(cmd);
-                               pb.directory(new File(FilePathResources.getEmulatorToolPath()));
-
-                               try {
-                                       Process process = pb.start();
-                                       ProcessOutputReader.startRead(process, "check-hax");
-                                       process.waitFor();
-                                       exitValue = process.exitValue();
-                                       EMLogger.getLogger().log(Level.CONFIG, "check-hax's exit value : " + exitValue);
-                               } catch (IOException e) {
-                                       EMLogger.getLogger().log(Level.WARNING, "IOException" + e.getMessage());
-                               }  catch (InterruptedException e) {
-                                       EMLogger.getLogger().log(Level.WARNING, "InterruptedException" + e.getMessage());
-                               }  catch (Exception e) {
-                                       EMLogger.getLogger().log(Level.WARNING, "Exception" + e.getMessage());
-                               }
-
-                               if(exitValue == 0) {
-                                       isVirtualizationSupport = true;
-
-                               } else if (exitValue == 1 ) {
-                                       isVirtualizationSupport = true;
-                                       isNonUG = true;
-
-                               } else {
-                                       isVirtualizationSupport = false;
-                               }
-                               virtualization_enable_command = "-enable-hax";
-
-                       } else if (System.getProperty("os.name").toLowerCase().indexOf("linux") > -1) {
-                               if(new File("/dev/kvm").canRead()) {
-                                       isVirtualizationSupport = true;
-                               } else {
-                                       isVirtualizationSupport = false;
-                               }
-                               EMLogger.getLogger().log(Level.CONFIG, "Result of reading '/dev/kvm' file is "
-                                               + (isVirtualizationSupport ? "true" : "false"));
-                               virtualization_enable_command = "-enable-kvm";
-                       } else {
-                               isVirtualizationSupport = false;
-                               virtualization_enable_command = "";
-                       }
-                       EMLogger.getLogger().log(Level.INFO, "Support HW virtualization: "
-                                       + (isVirtualizationSupport ? "true" : "false"));
-               }
-       }
-
        private static class GPUCheckWork extends Thread {
+               @Override
                public void run() {
                        GPU_enable_command = "-enable-gl";
 
@@ -244,34 +136,11 @@ public class CheckVirtualization {
        }
 }
 
-class CheckDialog {
-       private Shell dialog;
-
-       public void create() {
-               dialog = new Shell(Display.getCurrent(), SWT.APPLICATION_MODAL);
-               dialog.setText("Info");
-               dialog.setSize(300, 100);
-               dialog.setLayout(new GridLayout(1, false));
-               
-               Label label = new Label(dialog, SWT.NONE);
-               label.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, true));
-               label.setText("Please wait !!" + StringResources.NEW_LINE + "Check whether virtualization is supported.");
-       }
-       
-       public void open() {
-               dialog.open();
-       }
-
-       public void close() {
-               dialog.close();
-       }
-}
-
 class ProcessOutputReader extends Thread {
 
-       private BufferedReader reader;
-       private String processName;
-       private List<String> msgList = new ArrayList<String>();
+       private final BufferedReader reader;
+       private final String processName;
+       private final List<String> msgList = new ArrayList<String>();
 
        public ProcessOutputReader(BufferedReader reader, String processName) {
                this.reader = reader;
index cdc811e..c0f824a 100644 (file)
@@ -679,7 +679,7 @@ public class TapUtil {
                        try {
                                List<String> gwList = getDefaultGateway(getBridgeFromDevice(tapName));
                                if (gwList.size() == 1)
-                                       gateway = (String) gwList.get(0);
+                                       gateway = gwList.get(0);
                        } catch (VMWorkerException e) {
                                EMLogger.getLogger().warning(e.getMessage());
                        }
@@ -1337,6 +1337,7 @@ public class TapUtil {
                                        final MessageDialog messageDialog = new MessageDialog();
                                        if (isTapExist) {
                                                Display.getDefault().asyncExec(new Runnable() {
+                                                       @Override
                                                        public void run() {
                                                                messageDialog
                                                                                .openInfoDialog("Tap device created : "
@@ -1348,6 +1349,7 @@ public class TapUtil {
                                        final MessageDialog resultDialog = new MessageDialog();
                                        if (isTapExist) {
                                                Display.getDefault().asyncExec(new Runnable() {
+                                                       @Override
                                                        public void run() {
                                                                int res = resultDialog
                                                                                .openSelectionDialog("Tap device created : "
@@ -1370,6 +1372,7 @@ public class TapUtil {
                                EMLogger.getLogger().warning(e.getMessage());
                                final String msg = e.getMessage();
                                Display.getDefault().asyncExec(new Runnable() {
+                                       @Override
                                        public void run() {
                                                new MessageDialog()
                                                                .openWarningDialog("\nFailed to create tap device.\n\n"
@@ -1379,6 +1382,7 @@ public class TapUtil {
 
                        } finally {
                                Display.getDefault().asyncExec(new Runnable() {
+                                       @Override
                                        public void run() {
                                                dialog.close();
                                                comboViewItem.resetCombo();
index fa9bd9c..b01aa99 100644 (file)
@@ -32,8 +32,8 @@
 package org.tizen.emulator.manager.ui.detail.item.property;
 
 import org.eclipse.swt.widgets.Composite;
+import org.tizen.emulator.manager.job.CheckVT;
 import org.tizen.emulator.manager.resources.StringResources;
-import org.tizen.emulator.manager.tool.CheckVirtualization;
 import org.tizen.emulator.manager.ui.detail.item.template.LabelViewItem;
 import org.tizen.emulator.manager.ui.detail.item.template.OnOffSubViewItem;
 import org.tizen.emulator.manager.vms.VMPropertyValue;
@@ -58,7 +58,7 @@ public class CPUSupportSubViewItem extends OnOffSubViewItem {
 
        @Override
        public boolean settingDetailItem(VMPropertyValue value) {
-               if (!CheckVirtualization.getInstance().isSupportVirtualization()) {
+               if (!CheckVT.isVTSupported()) {
                        valueLabel.setText(StringResources.DISABLED);
                        valueLabel.setToolTipText(CPUDisableToolTipText);
                } else {
@@ -75,8 +75,7 @@ public class CPUSupportSubViewItem extends OnOffSubViewItem {
        public boolean settingModifyItem(VMPropertyValue value) {
                newValue = oldValue  = value.isHWVirtualization;
 
-               if (!CheckVirtualization.getInstance().isSupportVirtualization()
-                               || isArm) {
+               if (!CheckVT.isVTSupported() || isArm) {
                        onOffButton.setEnabled(false);
                        buttonLabel.setText(StringResources.DISABLED);
                        buttonLabel.setToolTipText(CPUDisableToolTipText);
index 1cc3fd1..a349cbb 100644 (file)
@@ -35,7 +35,7 @@ import java.util.List;
 
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
-import org.tizen.emulator.manager.tool.CheckVirtualization;
+import org.tizen.emulator.manager.job.CheckVT;
 import org.tizen.emulator.manager.ui.detail.item.ItemState;
 import org.tizen.emulator.manager.ui.detail.item.LineLabelViewItem;
 import org.tizen.emulator.manager.ui.detail.item.template.ComboViewItem;
@@ -105,7 +105,7 @@ public class ProcessorViewItem extends ComboViewItem {
                }
 
                if (isCreateMode()) {
-                       if (CheckVirtualization.getInstance().isNonUG()) {
+                       if (CheckVT.isNonUG()) {
                                value.cpu = 1;
 
                        } else {
@@ -147,7 +147,7 @@ public class ProcessorViewItem extends ComboViewItem {
        }
 
        private boolean checkUGWarning() {
-               if (CheckVirtualization.getInstance().isNonUG()) {
+               if (CheckVT.isNonUG()) {
                        if (newValue == null) {
                                return true;
                        } else if (Integer.parseInt(newValue) > 1) {
index e53688e..4665a32 100644 (file)
@@ -64,7 +64,7 @@ public class VMPropertyValue implements Cloneable {
        public int ramSize = 512;
        public int cpu = 1;
 
-       public boolean isFileShareSupport; 
+       public boolean isFileShareSupport;
        public String fileSharePath = "";
        public String fileSharePathName = "";
 
@@ -168,7 +168,7 @@ public class VMPropertyValue implements Cloneable {
                dest.ramSize = this.ramSize;
                dest.cpu = this.cpu;
 
-               dest.isFileShareSupport = this.isFileShareSupport; 
+               dest.isFileShareSupport = this.isFileShareSupport;
                dest.fileSharePath              = this.fileSharePath;
                dest.fileSharePathName  = this.fileSharePathName;
                dest.isHWVirtualization = this.isHWVirtualization;
@@ -374,8 +374,7 @@ public class VMPropertyValue implements Cloneable {
                        cpu = property.getConfiguration().getDevice().getCPU().getValue().getValue();
                }
 
-               isHWVirtualization = property.getConfiguration().getUsability().isHwVirtualization()
-                                                               && CheckVirtualization.getInstance().isSupportVirtualization();
+               isHWVirtualization = property.getConfiguration().getUsability().isHwVirtualization();
                isGLAcceleration = property.getConfiguration().getUsability().isHwGLAcceleration()
                                                                && CheckVirtualization.getInstance().isSupportGPU();
 
index 8bbf593..95fef30 100644 (file)
@@ -30,6 +30,7 @@ package org.tizen.emulator.manager.vms.option;
 
 import org.eclipse.swt.SWT;
 import org.tizen.emulator.manager.EmulatorManager;
+import org.tizen.emulator.manager.job.CheckVT;
 import org.tizen.emulator.manager.tool.CheckVirtualization;
 import org.tizen.emulator.manager.ui.dialog.MessageDialog;
 import org.tizen.emulator.manager.vms.VMProperty;
@@ -42,13 +43,10 @@ public class HWSupportOption extends Option {
                        throws VMLauncherException {
                // Set CPU option
                String hwVirtualization = "";
-               if (property.getConfiguration().getUsability().isHwVirtualization()
-                               && CheckVirtualization.getInstance().isSupportVirtualization()) {
-                       hwVirtualization = CheckVirtualization.getInstance()
-                                       .getVirtualizationEnableCommnad();
+               if (property.getConfiguration().getUsability().isHwVirtualization()) {
+                       hwVirtualization = CheckVT.getVTEnablingCommand();
                } else {
-                       hwVirtualization = CheckVirtualization.getInstance()
-                                       .getVirtualizationDisableCommnad();
+                       // do nothing...
                }
                if (hwVirtualization != null) {
                        config.addQemuOption(hwVirtualization);
index 9796637..24da9df 100644 (file)
@@ -29,7 +29,7 @@
 package org.tizen.emulator.manager.vms.option;
 
 import org.eclipse.swt.SWT;
-import org.tizen.emulator.manager.tool.CheckVirtualization;
+import org.tizen.emulator.manager.job.CheckVT;
 import org.tizen.emulator.manager.ui.dialog.MessageDialog;
 import org.tizen.emulator.manager.vms.CPU;
 import org.tizen.emulator.manager.vms.VMProperty;
@@ -48,7 +48,7 @@ public class ProcessorOption extends Option {
        public void checkArgument(VMProperty property) throws VMLauncherException {
                // Check non-UG mode.
                int cpu = getCpuNum(property);
-               if (CheckVirtualization.getInstance().isNonUG() && cpu > 1) {
+               if (CheckVT.isNonUG() && cpu > 1) {
                        MessageDialog dialog = new MessageDialog();
                        int response = dialog
                                        .openWarningAndSelectionDialog("Using multi-processor option might cause VM slower"
@@ -66,7 +66,7 @@ public class ProcessorOption extends Option {
                        return cpuType.getValue().getValue();
 
                } else {
-                       if (CheckVirtualization.getInstance().isNonUG()) {
+                       if (CheckVT.isNonUG()) {
                                return 1;
 
                        } else {