Fic minor bug, and update docs.

Change-Id: Ifdc2b019c499d995c8dc493dd4684dd21d0cf995
diff --git a/android/hw-qemud.c b/android/hw-qemud.c
index 16deae8..9bfeaff 100644
--- a/android/hw-qemud.c
+++ b/android/hw-qemud.c
@@ -21,8 +21,7 @@
 #include "charpipe.h"
 #include "cbuffer.h"
 
-//#define  D(...)    VERBOSE_PRINT(qemud,__VA_ARGS__)
-#define  D(...)    printf(__VA_ARGS__), printf("\n")
+#define  D(...)    VERBOSE_PRINT(qemud,__VA_ARGS__)
 #define  D_ACTIVE  VERBOSE_CHECK(qemud)
 
 /* the T(...) macro is used to dump traffic */
@@ -940,7 +939,6 @@
     }
 
     /* re-connect client */
-    // TODO: Save / load is_pipe here!
     QemudClient* c = qemud_service_connect_client(sv, channel);
     if(c == NULL)
         return -EIO;
@@ -1946,7 +1944,7 @@
     QemudClient*  client = pipe->client;
     unsigned ret = PIPE_WAKE_WRITE;
     if (client->ProtocolSelector.Pipe.messages != NULL) {
-        ret |= PIPE_WAKE_WRITE;
+        ret |= PIPE_WAKE_READ;
     }
 
     return ret;
diff --git a/docs/ANDROID-QEMUD.TXT b/docs/ANDROID-QEMUD.TXT
index 7841399..8b4f8d6 100644
--- a/docs/ANDROID-QEMUD.TXT
+++ b/docs/ANDROID-QEMUD.TXT
@@ -6,7 +6,9 @@
 The Android system image includes a small daemon program named "qemud"
 which is started at boot time. Its purpose is to provide a multiplexing
 communication channel between the emulated system and the emulator program
-itself.
+itself. Another way to support communication between the emulated system and
+the emulator program is using qemu pipes (see ANDROID-QEMU-PIPE.TXT for details
+on qemu pipes).
 
 Its goal is to allow certain parts of the system to talk directly to the
 emulator without requiring special kernel support; this simplifies a lot of
@@ -169,6 +171,17 @@
   Certain services do not need it at all (GSM, GPS) so it is optional and
   must be used depending on which service you talk to by clients.
 
+- QEMU pipe communication model works similarly to the serial port multiplexing,
+  but also has some differences as far as connecting client with the service is
+  concerned:
+
+     emulator <-+--> /dev/qemu_pipe/qemud:srv1 <---> client1
+                |
+                +--> /dev/qemu_pipe/qemud:srv2 <---> client2
+
+  In the pipe model each client gets connected to the emulator through a unique
+  handle to /dev/qemu_pipe (a "pipe"), so there is no need for multiplexing the
+  channels.
 
 III. Legacy 'qemud':
 --------------------
@@ -254,7 +267,7 @@
 IV. State snapshots:
 --------------------
 
-Support for snapshots relies on the symmetric qemud_*_save and qemud_*_load 
+Support for snapshots relies on the symmetric qemud_*_save and qemud_*_load
 functions which save the state of the various Qemud* structs defined in
 android/hw-qemud.c. The high-level process is as follows.