summaryrefslogtreecommitdiffstats
path: root/qemu
diff options
context:
space:
mode:
authorVladimir Chtchetkine <vchtchetkine@google.com>2011-08-04 13:57:57 -0700
committerVladimir Chtchetkine <vchtchetkine@google.com>2011-08-04 13:57:57 -0700
commit2dbd8949b2ac0aaa98f89a467c14bff857505794 (patch)
treef7c7cfd0e616d20cb84b1752f5d1b3437bf5e0da /qemu
parentef6b8ea3f664254958491f48fbe38c502d1129df (diff)
downloadhardware_libhardware_legacy-2dbd8949b2ac0aaa98f89a467c14bff857505794.zip
hardware_libhardware_legacy-2dbd8949b2ac0aaa98f89a467c14bff857505794.tar.gz
hardware_libhardware_legacy-2dbd8949b2ac0aaa98f89a467c14bff857505794.tar.bz2
Enable QEMUD pipe connection for all legacy hw-control clients
Change-Id: Ic713d4cdcddb724958fc8c1c8a82a1dc2733da32
Diffstat (limited to 'qemu')
-rw-r--r--qemu/qemu.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/qemu/qemu.c b/qemu/qemu.c
index de029be..731df78 100644
--- a/qemu/qemu.c
+++ b/qemu/qemu.c
@@ -36,6 +36,7 @@
# define D(...) ((void)0)
#endif
+#include "hardware/qemu_pipe.h"
int
qemu_check(void)
@@ -70,6 +71,24 @@ qemu_fd_read( int fd, char* buff, int len )
return len2;
}
+static int
+qemu_channel_open_qemud_pipe( QemuChannel* channel,
+ const char* name )
+{
+ int fd;
+ char pipe_name[512];
+
+ snprintf(pipe_name, sizeof(pipe_name), "qemud:%s", name);
+ fd = qemu_pipe_open(pipe_name);
+ if (fd < 0) {
+ D("no qemud pipe: %s", strerror(errno));
+ return -1;
+ }
+
+ channel->is_qemud = 1;
+ channel->fd = fd;
+ return 0;
+}
static int
qemu_channel_open_qemud( QemuChannel* channel,
@@ -174,6 +193,9 @@ qemu_channel_open( QemuChannel* channel,
channel->is_inited = 1;
do {
+ if (qemu_channel_open_qemud_pipe(channel, name) == 0)
+ break;
+
if (qemu_channel_open_qemud(channel, name) == 0)
break;
@@ -226,7 +248,7 @@ qemu_channel_open( QemuChannel* channel,
static int
-qemu_command_vformat( char* buffer,
+qemu_command_vformat( char* buffer,
int buffer_size,
const char* format,
va_list args )
@@ -247,7 +269,7 @@ qemu_command_vformat( char* buffer,
}
extern int
-qemu_command_format( char* buffer,
+qemu_command_format( char* buffer,
int buffer_size,
const char* format,
... )