[Title] Add mac specific codes. (at tool/CheckVirtualization.java , vms/VMsWorker...
authorSooyoung Ha <yoosah.ha@samsung.com>
Fri, 6 Jul 2012 02:56:55 +0000 (11:56 +0900)
committerSooyoung Ha <yoosah.ha@samsung.com>
Fri, 6 Jul 2012 02:56:55 +0000 (11:56 +0900)
[Type] work
[Module] emulator manager
[Priority] major
[Jira#]
[Redmine#] #5646
[Problem]
[Cause]
[Solution]
[TestCase]

src/org/tizen/emulator/manager/tool/CheckVirtualization.java
src/org/tizen/emulator/manager/vms/VMsWorker.java

index b0def22..7a1a0bd 100644 (file)
@@ -139,6 +139,9 @@ public class CheckVirtualization {
                                        isSupport = false;
                                }
                                enable_command = "-enable-kvm";
+                       } else {
+                               isSupport = false;
+                               enable_command = "";
                        }
                }
        }
index e95a5ef..037d016 100644 (file)
@@ -206,6 +206,7 @@ public class VMsWorker {
                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");
                try { 
                        String line;
                        List<String> cmd = new ArrayList<String>();
@@ -221,6 +222,11 @@ public class VMsWorker {
                                cmd.add("/FO");
                                cmd.add("CSV");
                        }
+                       else if (isMac > -1){
+                               cmd.add("/bin/ps");
+                               cmd.add("-ef");
+                       }
+
 
                        ProcessBuilder pb = new ProcessBuilder(cmd);
                        Process p = pb.start();
@@ -247,7 +253,18 @@ public class VMsWorker {
                                                return true; 
                                        }
                                }
-                       }               
+                       }
+                       else if(isMac > -1) {
+                                while ((line = stdOut.readLine()) != null) {
+                                        String imagePath = FileIO.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 + ")");
+                                                stdOut.close();
+                                                return true;
+                                        }
+                                }
+                        }              
                        stdOut.close();
                        logger.log(Level.INFO, "not exist anywhere\n");
                        return false;                                                    
@@ -325,4 +342,4 @@ class CreateBaseImageDialog {
                return dialog.isDisposed();
        }
 }
-*/
\ No newline at end of file
+*/