Modify the method of look-up loopback interface sophisticatedly.
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Tue, 18 Jun 2013 08:16:15 +0000 (17:16 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Tue, 18 Jun 2013 12:43:06 +0000 (21:43 +0900)
Change-Id: I83ff19a1bfc32de5f70b22ca9ce09cc3b8ec5dde
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
qemu-sockets.c
tizen/src/skin/maruskin_operation.c

index 361d890da3e812abb6d2e09088bc2c0f6792d54d..34cbbde01a03ecf20beb15377b794b7dec1fd5fb 100644 (file)
@@ -242,6 +242,14 @@ int inet_connect_opts(QemuOpts *opts, bool *in_progress, Error **errp)
     if (qemu_opt_get_bool(opts, "ipv6", 0))
         ai.ai_family = PF_INET6;
 
+#ifdef CONFIG_MARU
+    // for lookup loopback interface...
+    if (addr[0] == '\0') {
+        ai.ai_flags = 0;
+        addr = NULL;
+    }
+#endif
+
     /* lookup */
     if (0 != (rc = getaddrinfo(addr, port, &ai, &res))) {
         fprintf(stderr,"getaddrinfo(%s,%s): %s\n", addr, port,
index 476c063372932d7e34b58dcb5a2d557ce3de04fc..65c6b3dd29c5fd507935c6c7ba27d428e01b2bc6 100644 (file)
@@ -40,7 +40,7 @@
 #include "emulator.h"
 #include "debug_ch.h"
 #include "sdb.h"
-#include "nbd.h"
+#include "qemu_socket.h"
 #include "mloop_event.h"
 #include "emul_state.h"
 #include "maruskin_keymap.h"
@@ -582,10 +582,14 @@ static void* run_timed_shutdown_thread(void* args)
 static void send_to_emuld(const char* request_type,
     int request_size, const char* send_buf, int buf_size)
 {
-    int s = tcp_socket_outgoing( "127.0.0.1", (uint16_t) ( tizen_base_port + SDB_TCP_EMULD_INDEX ) );
+    char addr[128];
+    int s = 0;
+
+    snprintf(addr, 128, ":%u", (uint16_t) (tizen_base_port + SDB_TCP_EMULD_INDEX));
+    s = inet_connect(addr, true, NULL, NULL);
 
     if ( s < 0 ) {
-        ERR( "can't create socket to talk to the sdb forwarding session \n" );
+        ERR( "can't create socket to emulator daemon in guest\n" );
         ERR( "[127.0.0.1:%d/tcp] connect fail (%d:%s)\n" , tizen_base_port + SDB_TCP_EMULD_INDEX , errno, strerror(errno) );
         return;
     }