Create a vsock_half_tunnel mode.
This uses native adb/vsock support in the guest, but presents a TCP
connection on the host that can be used across the network. This is a
compromise between the high-performance vsock code and remote access.
Observed behavior with adb push/pull:
$ adb push ~/tmp/100m /data/local/tmp
1 file pushed. 135.9 MB/s (104857600 bytes in 0.736s)
$ adb push ~/tmp/100m /data/local/tmp
1 file pushed. 229.4 MB/s (104857600 bytes in 0.436s)
$ adb pull /data/local/tmp ~/tmp/100m2
1 file pulled. 13.2 MB/s (104857600 bytes in 7.603s)
Push is surprisingly close to the performance of native_vsock, while
pull is still comparable to tunnel and vsock_tunnel.
Test: Run with -adb_mode=vsock_half_tunnel
Bug: 121166534
Change-Id: Ia11ff2915b7799d7dbbc3f6a99de33e5ad9e19b3
diff --git a/host/commands/launch/flags.cc b/host/commands/launch/flags.cc
index 4548588..ae5d0e6 100644
--- a/host/commands/launch/flags.cc
+++ b/host/commands/launch/flags.cc
@@ -119,9 +119,13 @@
vsoc::DefaultHostArtifactsPath("bin/socket_vsock_proxy"),
"Location of the socket_vsock_proxy binary.");
DEFINE_string(adb_mode, "",
- "Mode for adb connection. Can be 'usb' for usb forwarding, "
- "'tunnel' for tcp connection, 'vsock_tunnel' for vsock tcp,"
- "or a comma separated list of types as in 'usb,tunnel'");
+ "Mode for ADB connection. Can be 'usb' for USB forwarding, "
+ "'tunnel' for a TCP connection tunneled through VSoC, "
+ "'vsock_tunnel' for a TCP connection tunneled through vsock, "
+ "'native_vsock' for a direct connection to the guest ADB over "
+ "vsock, 'vsock_half_tunnel' for a TCP connection forwarded to "
+ "the guest ADB server, or a comma separated list of types as in "
+ "'usb,tunnel'");
DEFINE_bool(run_adb_connector, true,
"Maintain adb connection by sending 'adb connect' commands to the "
"server. Only relevant with --adb_mode=tunnel or vsock_tunnel");