[Esbox-commits] r2236 - 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
Mon Sep 28 18:38:14 EEST 2009
Author: eswartz
Date: 2009-09-28 18:38:05 +0300 (Mon, 28 Sep 2009)
New Revision: 2236
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/VMwareUtils.java
Log:
-- Do not select DHCP address which is the same as the network address
-- Use vmnet mapping for network type
-- Fix vmplayer command line
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-09-28 13:48:47 UTC (rev 2235)
+++ branches/work_Ed/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/VMwareMachineController.java 2009-09-28 15:38:05 UTC (rev 2236)
@@ -149,7 +149,7 @@
IPath launchPath = getExecutablePath(vmwareConfiguration);
cmdLine.add(launchPath.toOSString());
- if (!HostUtils.isOSX()) {
+ if (!HostUtils.isOSX() && !vmwareConfiguration.getProduct().equals(IVMwareConfiguration.PRODUCT_PLAYER)) {
cmdLine.add("-x");
}
cmdLine.add(new Path(vmwareConfiguration.getVmxPath()).toOSString());
Modified: branches/work_Ed/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/VMwareUtils.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/VMwareUtils.java 2009-09-28 13:48:47 UTC (rev 2235)
+++ branches/work_Ed/org.maemo.esbox.vm.vmware/src/org/maemo/esbox/internal/vm/vmware/VMwareUtils.java 2009-09-28 15:38:05 UTC (rev 2236)
@@ -35,6 +35,7 @@
import org.maemo.esbox.vm.vmware.IVMwareConfiguration;
import org.maemo.mica.common.core.HostUtils;
import org.maemo.mica.common.core.MicaException;
+import org.maemo.mica.common.core.NetworkUtils;
import org.maemo.mica.common.core.TimeoutProgressMonitor;
import org.maemo.mica.common.core.machine.MachineRegistry;
import org.maemo.mica.common.core.process.CommandLineArguments;
@@ -134,12 +135,23 @@
* @return String, {@value #NETWORK_CONFIG_BRIDGED}, {@value #NETWORK_CONFIG_HOSTONLY}, {@value #NETWORK_CONFIG_NAT}
*/
public static String getNetworkConfig(Map<String, String> vmxSettings) {
+ String config = null;
for (Map.Entry<String, String> entry : vmxSettings.entrySet()) {
+ if (entry.getKey().matches("ethernet.*\\.vnet")) {
+ String vmnet = entry.getValue();
+ if (vmnet.endsWith("vmnet8")) {
+ return NETWORK_CONFIG_NAT;
+ } else if (vmnet.endsWith("vmnet1")) {
+ return NETWORK_CONFIG_HOSTONLY;
+ } else if (vmnet.endsWith("vmnet0")) {
+ return NETWORK_CONFIG_BRIDGED;
+ }
+ }
if (entry.getKey().matches("ethernet.*\\.connectionType")) {
- return entry.getValue();
+ config = entry.getValue();
}
}
- return null;
+ return config;
}
/**
@@ -157,12 +169,14 @@
for (int last = 131; last > 128; last--) {
addr[3] = (byte) last;
InetAddress candidate = InetAddress.getByAddress(addr);
- try {
- if (candidate.isReachable(100)) {
- return candidate;
+ if (!NetworkUtils.isLocalAddress(candidate)) {
+ try {
+ if (candidate.isReachable(100)) {
+ return candidate;
+ }
+ } catch (IOException e) {
+ // nope
}
- } catch (IOException e) {
- // nope
}
}
More information about the Esbox-commits
mailing list