From: Munkyu Im Date: Wed, 11 Feb 2015 05:56:23 +0000 (+0900) Subject: net: Add checking network X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5655365ba29f1a656c05b6a9c1f876083e69c9d;p=sdk%2Femulator%2Fqemu.git net: Add checking network If Emulator use bridged network, it is not necessary to use adding port-forwarding of ECP Network tab. So send message to ECP to recognize it. Change-Id: I131f854a4ca59f6d6887ddeeeffd591bedcadcec Signed-off-by: Munkyu Im --- diff --git a/net/tap.c b/net/tap.c index bde6b58b17..7bd199cec6 100644 --- a/net/tap.c +++ b/net/tap.c @@ -43,6 +43,9 @@ #include "net/tap.h" #include "net/vhost_net.h" +#if defined(CONFIG_MARU) +#include "tizen/src/emul_state.h" +#endif typedef struct TAPState { NetClientState nc; @@ -699,7 +702,9 @@ int net_init_tap(const NetClientOptions *opts, const char *name, tap = opts->tap; queues = tap->has_queues ? tap->queues : 1; vhostfdname = tap->has_vhostfd ? tap->vhostfd : NULL; - +#if defined(CONFIG_MARU) + set_emul_tap_enable(true); +#endif /* QEMU vlans does not support multiqueue tap, in this case peer is set. * For -netdev, peer is always NULL. */ if (peer && (tap->has_queues || tap->has_fds || tap->has_vhostfds)) { diff --git a/tizen/src/ecs/ecs.h b/tizen/src/ecs/ecs.h index ae3e92377d..17d1393110 100644 --- a/tizen/src/ecs/ecs.h +++ b/tizen/src/ecs/ecs.h @@ -90,7 +90,8 @@ enum message_action { MSG_ACT_PRESSURE = 116, MSG_ACT_UV = 117, MSG_ACT_HRM = 118, - MSG_ACT_LOCATION = 120 + MSG_ACT_LOCATION = 120, + MSG_ACT_NETBRIDGE = 123 }; #define TIMER_ALIVE_S 60 diff --git a/tizen/src/ecs/ecs_msg_device.c b/tizen/src/ecs/ecs_msg_device.c index 338560a2dd..0f4d956864 100644 --- a/tizen/src/ecs/ecs_msg_device.c +++ b/tizen/src/ecs/ecs_msg_device.c @@ -400,6 +400,11 @@ bool msgproc_device_req(ECS_Client* ccli, ECS__DeviceReq* msg) if (!strcmp(cmd, MSG_TYPE_SENSOR)) { msgproc_device_req_sensor(ccli, msg, cmd); } else if (!strcmp(cmd, "Network")) { + if (msg->action == MSG_ACT_NETBRIDGE) { + make_send_device_ntf(cmd, is_emul_tap_enable(), msg->action, NULL); + } else { + LOG_SEVERE("unsupported action value: %d\n", msg->action); + } msgproc_device_req_network(ccli, msg); } else if (!strcmp(cmd, "TGesture")) { msgproc_device_req_tgesture(ccli, msg); diff --git a/tizen/src/ui/menu/contextmenu.cpp b/tizen/src/ui/menu/contextmenu.cpp index b1d0bc2aba..6735cb22dd 100644 --- a/tizen/src/ui/menu/contextmenu.cpp +++ b/tizen/src/ui/menu/contextmenu.cpp @@ -500,7 +500,12 @@ void ContextMenu::slotShell() } QString sdbPort = QString::number(get_device_serial_number()); - QString sdbSerialName = "emulator-" + sdbPort; + QString sdbSerialName; + if (is_emul_tap_enable()) { + sdbSerialName = QString(get_emul_guest_ip()); + } else { + sdbSerialName = "emulator-" + sdbPort; + } QString sdbPath = QCoreApplication::applicationDirPath(); #ifdef CONFIG_WIN32 @@ -668,7 +673,6 @@ void ContextMenu::slotControlPanel() arguments << "-XstartOnFirstThread"; #endif arguments << "-jar" << ecpPath << vmNameOpt << basePortOpt; - qDebug() << command << arguments; try {