[Esbox-commits] r2316 - branches/work_Ed/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware

eswartz at garage.maemo.org eswartz at garage.maemo.org
Fri Oct 16 16:27:43 EEST 2009


Author: eswartz
Date: 2009-10-16 16:27:41 +0300 (Fri, 16 Oct 2009)
New Revision: 2316

Modified:
   branches/work_Ed/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/VMwareMachineController.java
Log:
For VMWare under Windows, revert probing behavior to optimistically test SSH before using very slow "vmrun" check.

Modified: branches/work_Ed/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/VMwareMachineController.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/VMwareMachineController.java	2009-10-15 17:51:50 UTC (rev 2315)
+++ branches/work_Ed/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/VMwareMachineController.java	2009-10-16 13:27:41 UTC (rev 2316)
@@ -324,12 +324,25 @@
 	 */
 	@Override
 	protected IStatus doProbeMachine(IProgressMonitor monitor) {
-		if (!isMachineRunning())
-			return Activator.createErrorStatus("VMware is not running " 
-					+ ((IVirtualMachine) machine).getDescriptiveName(), null);
-		
-		IStatus status = super.doProbeMachine(monitor);
-		return status;
+		if (HostUtils.isWindows()) {
+			// vmrun is horribly slow in Windows, so an SSH ping is usually faster
+			IStatus status = super.doProbeMachine(monitor);
+			if (status.isOK())
+				return status;
+			
+			if (!isMachineRunning())
+				return Activator.createErrorStatus("VMware is not running " 
+						+ ((IVirtualMachine) machine).getDescriptiveName(), null);
+			
+			return status;
+		} else {
+			if (!isMachineRunning())
+				return Activator.createErrorStatus("VMware is not running " 
+						+ ((IVirtualMachine) machine).getDescriptiveName(), null);
+			
+			IStatus status = super.doProbeMachine(monitor);
+			return status;
 
+		}
 	}
 }



More information about the Esbox-commits mailing list