emulator: some jobs prepared after device init
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Thu, 28 May 2015 11:37:13 +0000 (20:37 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Fri, 29 May 2015 02:08:04 +0000 (11:08 +0900)
Change-Id: Ife5b6045dadbbd52647f57cbddeae5b64b0ec677
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
tizen/src/emulator.c
tizen/src/emulator.h
vl.c

index c9813a187292b20864eb67ea35dd2d3db0092f9f..f2cb7ed06d18d43cb844dab702958cd0cd509517 100644 (file)
@@ -216,27 +216,12 @@ static void prepare_basic_features(gchar * const kernel_cmdline)
     gchar * tmp_str;
 
     set_base_port();
-
-    make_vm_lock_os();
-
-    maru_device_hotplug_init();
-
-    start_ecs();
-
-    start_sdb_noti_server(get_emul_vm_base_port() + SDB_UDP_SENSOR_INDEX);
-
-    sdb_setup();
-
     tmp_str = g_strdup_printf(" sdb_port=%d,"
             " vm_resolution=%dx%d", get_emul_vm_base_port(),
             get_emul_resolution_width(), get_emul_resolution_height());
-
     set_emul_host_ip(kernel_cmdline);
-
     http_proxy_setup(kernel_cmdline);
-
     g_strlcat(kernel_cmdline, tmp_str, LEN_MARU_KERNEL_CMDLINE);
-
     g_free(tmp_str);
 }
 
@@ -280,11 +265,9 @@ const char *prepare_maru(const gchar * const kernel_cmdline)
     LOG_INFO("Prepare maru specified feature\n");
 
     g_strlcpy(maru_kernel_cmdline, kernel_cmdline, LEN_MARU_KERNEL_CMDLINE);
-
     /* Prepare basic features */
     LOG_INFO("Prepare_basic_features\n");
     prepare_basic_features(maru_kernel_cmdline);
-
     /* Prepare GL acceleration */
 #ifdef CONFIG_YAGL
     LOG_INFO("Prepare_opengl_acceleration\n");
@@ -296,6 +279,15 @@ const char *prepare_maru(const gchar * const kernel_cmdline)
     return maru_kernel_cmdline;
 }
 
+void prepare_maru_after_device_init(void)
+{
+    make_vm_lock_os();
+    maru_device_hotplug_init();
+    start_ecs();
+    start_sdb_noti_server(get_emul_vm_base_port() + SDB_UDP_SENSOR_INDEX);
+    sdb_setup();
+}
+
 #if defined(CONFIG_SDL) || defined(CONFIG_USE_SHM)
 void start_skin(void)
 {
index cd918b483de04e0e4d1c1803d22a502cbcbf62fb..4a62b7289611a7ef4af14a89e240fb9f01089b01 100644 (file)
@@ -43,6 +43,7 @@
 #include "sysemu/sysemu.h"
 
 const char *prepare_maru(const gchar * const kernel_cmdline);
+void prepare_maru_after_device_init(void);
 void start_skin(void);
 
 void emulator_add_exit_notifier(Notifier *notify);
diff --git a/vl.c b/vl.c
index 18269c722d2c949cbbf802958c40c67d8c325277..565f818a5e32cf03254bae9ecf25b251fa49218b 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -4490,6 +4490,9 @@ int main(int argc, char **argv, char **envp)
     if (qemu_opts_foreach(qemu_find_opts("device"), device_init_func, NULL, 1) != 0)
         exit(1);
 
+#if defined(CONFIG_MARU)
+    prepare_maru_after_device_init();
+#endif
 #ifdef CONFIG_VIGS
     // To support legacy VIGS options
     if (enable_vigs) {