[qemu]: Move qemu_pipe.h from include/system/ directory.
The <hardware/qemu_pipe.h> header isn't related to any loadable
hardware module, this patch thus relocates it to <system/qemu_pipe.h>
which is a much more logical location.
Note the following changes:
- The pipe name must begin with the 'pipe:' prefix to avoid an
un-necessary snprintf() and buffer copy.
- Does not probe for the obsolete /dev/goldfish_pipe device, i.e.
only use /dev/qemu_pipe instead.
- Use QEMU_PIPE_DEBUG() instead of D() as the debugging macro.
+ Update ADB to use the newest <system/qemu_pipe.h>
+ Add qemu_pipe_frame_send() and qemu_pipe_frame_recv() utility
functions which replace the obsolete qemud_channel_send() and
qemud_channel_recv() from the defunct <hardware/qemud.h>
header.
BUG=25875346
Change-Id: Ic290a5b79d466c2af64b49bd9134643277c11bfd
diff --git a/adb/transport_local.cpp b/adb/transport_local.cpp
index 31b5ad6..d918cc7 100644
--- a/adb/transport_local.cpp
+++ b/adb/transport_local.cpp
@@ -235,16 +235,20 @@
/* This is relevant only for ADB daemon running inside the emulator. */
/*
* Redefine open and write for qemu_pipe.h that contains inlined references
- * to those routines. We will redifine them back after qemu_pipe.h inclusion.
+ * to those routines. We will redefine them back after qemu_pipe.h inclusion.
*/
#undef open
+#undef read
#undef write
#define open adb_open
+#define read adb_read
#define write adb_write
-#include <hardware/qemu_pipe.h>
+#include <system/qemu_pipe.h>
#undef open
+#undef read
#undef write
#define open ___xxx_open
+#define read ___xxx_read
#define write ___xxx_write
/* A worker thread that monitors host connections, and registers a transport for
@@ -292,7 +296,7 @@
D("transport: qemu_socket_thread() starting");
/* adb QEMUD service connection request. */
- snprintf(con_name, sizeof(con_name), "qemud:adb:%d", port);
+ snprintf(con_name, sizeof(con_name), "pipe:qemud:adb:%d", port);
/* Connect to the adb QEMUD service. */
fd = qemu_pipe_open(con_name);