From d4d688e926097faba7fd3717d1c0d3f296bdb526 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Tue, 26 Apr 2011 18:09:17 +0200 Subject: New goldfish_pipe virtual device. This adds a new virtual hardware device named "goldfish_pipe" used to implement a very fast communication channel between the guest system and the emulator. IMPORTANT: This depends on a special kernel driver, see: https://review.source.android.com/#change,22496 Usage from the guest is simply the following: fd = open("/dev/qemu_pipe", O_RDWR); const char* pipename = "pipe:"; ret = write(fd, pipename, strlen(pipename)+1); if (ret < 0) { /* could not connect to service named */ } /* now you can read()/write()/close() as a normal * file descriptor to exchange data with the service. */ In addition, this implements the following pipe services in the emulator: tcp: tcp:: unix: opengles The 'tcp:' and 'unix:' services simply redirect to a TCP or Unix socket on the host with minimal The 'opengles' service simply connects to tcp:locahost:22468 for now. We may change this to be more configurable in the future, but that's the port number used by the current experimental OpenGL ES hardware emulation host libraries / programs. Benchmarking with a simple ping-pong program shows that the guest <-> emulator can achieve a roundtrip bandwidth of 192 MB/s (on a 2.7 Ghz Xeon PC). Using the tcp: service to talk to a ping-pong server listening on localhost reaches 102 MB/s on the same machine, using a Unix socket reaches 140 MB/s. By contrast, using standard sockets in the guest reaches only 3.8 MB/s on the same machine (and requires special privileges from the application anyway). --- vl-android.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'vl-android.c') diff --git a/vl-android.c b/vl-android.c index 1d730f5..6653286 100644 --- a/vl-android.c +++ b/vl-android.c @@ -52,7 +52,6 @@ #include "modem_driver.h" #include "android/gps.h" #include "android/hw-qemud.h" -#include "android/hw-qemud-pipe.h" #include "android/hw-kmsg.h" #include "android/charmap.h" #include "android/globals.h" @@ -64,6 +63,7 @@ #include "android/utils/tempfile.h" #include "android/display-core.h" #include "android/utils/timezone.h" +#include "android/pipe-net.h" #include "android/snapshot.h" #include "targphys.h" #include "tcpdump.h" @@ -4045,6 +4045,7 @@ int main(int argc, char **argv, char **envp) /* Initialize boot properties. */ boot_property_init_service(); android_hw_control_init(); + android_net_pipes_init(); optind = 1; for(;;) { @@ -5175,7 +5176,7 @@ int main(int argc, char **argv, char **envp) } /* Initialize OpenGLES emulation */ - android_hw_opengles_init(); + //android_hw_opengles_init(); if (android_op_cpu_delay) { char* end; -- cgit v1.1