From: Jinhyung Choi Date: Wed, 30 Oct 2013 06:18:23 +0000 (+0900) Subject: guest_server: added a sending suspend state after sdb server registers X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~674 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=369f7450d3f3e4a819fc19c8b6571a2e636fbd31;p=sdk%2Femulator%2Fqemu.git guest_server: added a sending suspend state after sdb server registers Change-Id: I303b143a329d43ba5f830d9301b5cc0ee0d70fb8 Signed-off-by: Jinhyung Choi --- diff --git a/tizen/src/guest_server.c b/tizen/src/guest_server.c index 72782d8b86..e2b0d44fda 100644 --- a/tizen/src/guest_server.c +++ b/tizen/src/guest_server.c @@ -53,6 +53,7 @@ #include "sdb.h" #include "maru_common.h" #include "hw/maru_virtio_hwkey.h" +#include "hw/maru_pm.h" MULTI_DEBUG_CHANNEL(qemu, guest_server); @@ -76,34 +77,6 @@ clients = QTAILQ_HEAD_INITIALIZER(clients); static pthread_mutex_t mutex_clilist = PTHREAD_MUTEX_INITIALIZER; -static void add_sdb_client(const char* addr, int port) -{ - GS_Client *client = g_malloc0(sizeof(GS_Client)); - if (NULL == client) { - INFO("GS_Client allocation failed.\n"); - return; - } - - if (addr == NULL || strlen(addr) <= 0) { - INFO("GS_Client client's address is EMPTY.\n"); - return; - } else if (strlen(addr) > RECV_BUF_SIZE) { - INFO("GS_Client client's address is too long. %s\n", addr); - return; - } - - strcpy(client->addr, addr); - client->port = port; - - pthread_mutex_lock(&mutex_clilist); - - QTAILQ_INSERT_TAIL(&clients, client, next); - - pthread_mutex_unlock(&mutex_clilist); - - INFO("Added new sdb client. ip: %s, port: %d\n", client->addr, client->port); -} - static void remove_sdb_client(GS_Client* client) { if (client == NULL) { @@ -164,6 +137,36 @@ void notify_all_sdb_clients(int state) } +static void add_sdb_client(const char* addr, int port) +{ + GS_Client *client = g_malloc0(sizeof(GS_Client)); + if (NULL == client) { + INFO("GS_Client allocation failed.\n"); + return; + } + + if (addr == NULL || strlen(addr) <= 0) { + INFO("GS_Client client's address is EMPTY.\n"); + return; + } else if (strlen(addr) > RECV_BUF_SIZE) { + INFO("GS_Client client's address is too long. %s\n", addr); + return; + } + + strcpy(client->addr, addr); + client->port = port; + + pthread_mutex_lock(&mutex_clilist); + + QTAILQ_INSERT_TAIL(&clients, client, next); + + pthread_mutex_unlock(&mutex_clilist); + + INFO("Added new sdb client. ip: %s, port: %d\n", client->addr, client->port); + + send_to_client(client, is_suspended_state()); +} + static int parse_val(char* buff, unsigned char data, char* parsbuf) { int count = 0;