static Notifier ecs_exit = { .notify = ecs_notify_exit };
int start_ecs(void) {
+ qemu_add_opts(&qemu_ecs_opts);
+
qemu_thread_create(&ecs_thread_id, "ecs", ecs_initialize, NULL, QEMU_THREAD_JOINABLE);
emulator_add_exit_notifier(&ecs_exit);
set_bin_path_os(exec_argv);
}
-static void check_vm_lock(void)
-{
- check_vm_lock_os();
-}
-
static void make_vm_lock(void)
{
make_vm_lock_os();
clean_websocket_port(SIGKILL);
#endif
- check_vm_lock();
make_vm_lock();
maru_device_hotplug_init();
- qemu_add_opts(&qemu_ecs_opts);
start_ecs();
- start_sdb_noti_server(get_device_serial_number() + SDB_UDP_SENSOR_INDEX);
-
- sdb_setup();
+ sdb_setup(get_device_serial_number() + SDB_UDP_SENSOR_INDEX);
get_host_proxy(http_proxy, https_proxy, ftp_proxy, socks_proxy);
return value;
}
-void check_vm_lock_os(void)
+static void check_vm_lock_os(void)
{
/* TODO: */
}
{
char *shared_memory;
int base_port;
+
+ check_vm_lock_os();
+
base_port = get_emul_vm_base_port();
g_shmid = shmget((key_t)base_port, getpagesize(), 0666|IPC_CREAT);
if (g_shmid == -1) {
{ "gconftool-2 -g /system/proxy/socks_port", "gsettings get org.gnome.system.proxy.socks port" },
};
-void check_vm_lock_os(void)
+static void check_vm_lock_os(void)
{
int shm_id;
void *shm_addr;
{
int base_port;
+ check_vm_lock_os();
+
base_port = get_emul_vm_base_port();
g_shmid = shmget((key_t)base_port, getpagesize(), 0666|IPC_CREAT);
static const char *pactempfile = ".autoproxy";
-void check_vm_lock_os(void)
+static void check_vm_lock_os(void)
{
uint32_t port;
char *base_port = NULL;
char *shared_memory;
int base_port;
+ check_vm_lock_os();
+
base_port = get_emul_vm_base_port();
shared_memory = g_strdup_printf("%s", tizen_target_img_path);
port_in_use = g_strdup_printf("%d", base_port);
extern const char *pac_tempfile;
-void check_vm_lock_os(void);
void make_vm_lock_os(void);
void remove_vm_lock_os(void);
bool make_sdcard_lock_os(char *sdcard);
set_emul_vm_base_port(base_port);
}
-void sdb_setup(void)
-{
- int tries = 10;
- int success = 0;
- char buf[64] = {0,};
- int number;
-
- number = get_device_serial_number();
-
- for ( ; tries > 0; tries--, number += 10 ) {
- sprintf(buf, "tcp:%d::%d", number, number);
- if(net_slirp_redir((char*)buf) < 0)
- continue;
-
- INFO( "SDBD established on port %d\n", number);
- success = 1;
- break;
- }
-
- INFO("redirect [%s] success\n", buf);
- if (!success) {
- INFO( "it seems too many emulator instances are running on this machine. Aborting\n" );
- exit(1);
- }
-
- INFO( "Port(%d/tcp) listen for SDB\n", number);
-}
-
int sdb_loopback_client(int port, int type)
{
struct sockaddr_in addr;
static Notifier sdb_noti_server_exit = { .notify = sdb_noti_server_notify_exit };
-void start_sdb_noti_server(int server_port)
+static void start_sdb_noti_server(int server_port)
{
SDB_Noti_Server *server;
int ret;
emulator_add_exit_notifier(&sdb_noti_server_exit);
}
+void sdb_setup(int server_port)
+{
+ int tries = 10;
+ int success = 0;
+ char buf[64] = {0,};
+ int number;
+
+ start_sdb_noti_server(server_port);
+
+ number = get_device_serial_number();
+
+ for ( ; tries > 0; tries--, number += 10 ) {
+ sprintf(buf, "tcp:%d::%d", number, number);
+ if(net_slirp_redir((char*)buf) < 0)
+ continue;
+
+ INFO( "SDBD established on port %d\n", number);
+ success = 1;
+ break;
+ }
+
+ INFO("redirect [%s] success\n", buf);
+ if (!success) {
+ INFO( "it seems too many emulator instances are running on this machine. Aborting\n" );
+ exit(1);
+ }
+
+ INFO( "Port(%d/tcp) listen for SDB\n", number);
+}
+
#define SDB_TCP_OPENGL_INDEX 3 /* opengl server port */
#define SDB_UDP_SENSOR_INDEX 2 /* sensor server port */
-void sdb_setup(void);
+void sdb_setup(int server_port);
void set_base_port(void);
int inet_strtoip(const char* str, uint32_t *ip);
int socket_send(int fd, const void* buf, int buflen);
int check_port_bind_listen(uint32_t port);
int sdb_loopback_client(int port, int type);
-void start_sdb_noti_server(int server_port);
-
#define STATE_RUNNING 0
#define STATE_SUSPEND 1
void notify_all_sdb_clients(int state);