Merge branch 'tizen_2.4_develop' into tizen_3.0_develop
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Wed, 19 Aug 2015 07:32:14 +0000 (16:32 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Wed, 19 Aug 2015 08:07:24 +0000 (17:07 +0900)
Change-Id: I6753087cb299be5eb2b17c2ed256786021a4a27d
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
12 files changed:
1  2 
configure
package/changelog
package/pkginfo.manifest
tizen/emulator_configure.sh
tizen/src/Makefile
tizen/src/emul_state.c
tizen/src/emul_state.h
tizen/src/emulator.c
tizen/src/hw/virtio/maru_virtio_evdi.c
tizen/src/util/error_handler.c
ui/input.c
ui/spice-input.c

diff --cc configure
Simple merge
index 9327ef9cb2b47af338fd309eefdb6a59b9975b81,667f8cd7c6df7256a185083421aff2c493a86f8f..0044cdee4b1197b1d3c9cf38387e44826faf8198
@@@ -1,9 -1,12 +1,12 @@@
+ * 2.2.43
+ - enable DPI information on Detailed Info dialog
+ == GiWoong Kim <giwoong.kim@samsung.com> 2015-08-13
  * 2.2.42
 -- changed ecp launch path to common directory on menu
 -== Jinhyung Choi <jinh0.choi@samsung.com> 2015-08-07
 +- fixed dest dir of emulator binary on DIBS
 +== Sooyoung Ha <yoosah.ha@samsung.com> 2015-08-05
  * 2.2.41
 -- schedules controller object for deletion
 -== GiWoong Kim <giwoong.kim@samsung.com> 2015-08-06
 +- modify platform version 2.4 -> 3.0
 +== Sooyoung Ha <yoosah.ha@samsung.com> 2015-08-05
  * 2.2.40
  - support network disconnect event
  == Munkyu Im <munkyu.im@samsung.com> 2015-07-28
Simple merge
index 511cb0b484e246502307d73928b0048eccc59c39,d1326040ff3ef9537513165feb256b487339fb2f..d6cd88df7b402cf401ec13bebe89e042d2cc4715
@@@ -79,7 -77,7 +79,7 @@@ if [ -z "$EMUL_TARGET_LIST" ] ; the
  fi
  
  # append common flags
- CONFIGURE_APPEND="--target-list=$EMUL_TARGET_LIST --enable-yagl --enable-curl --enable-vigs --enable-maru --enable-qt --enable-libav --enable-libpng --disable-sdl --disable-gtk --disable-vnc --disable-curses --disable-quorum --disable-xen $CONFIGURE_APPEND"
 -CONFIGURE_APPEND="--target-list=$EMUL_TARGET_LIST --enable-yagl --enable-curl --disable-gtk --disable-quorum --enable-vigs --enable-maru --enable-libav --enable-libpng --enable-qt $CONFIGURE_APPEND"
++CONFIGURE_APPEND="--target-list=$EMUL_TARGET_LIST --enable-yagl --enable-curl --enable-vigs --enable-maru --enable-qt --enable-libav --enable-libpng --disable-sdl --disable-gtk --disable-vnc --disable-spice --disable-curses --disable-quorum --disable-xen $CONFIGURE_APPEND"
  
  if [ -z ${PKG_CONFIG_PATH} ] ; then   # avoid pkg-config bug on Windows
  export PKG_CONFIG_PATH=${TIZEN_SDK_DEV_PATH}/distrib/lib/pkgconfig
Simple merge
index 7dfc2a8da677d090e8b0de75421c9c0d177dd069,42217b3924b67e1db7df8bbba6b44cc8af511601..c65903a7f9eddb0f294ab2b3c069914f1d639f21
@@@ -65,40 -68,12 +68,6 @@@ DECLARE_DEBUG_CHANNEL(emul_state)
  static EmulatorConfigInfo _emul_info = {0,};
  static EmulatorConfigState _emul_state;
  
--/* misc */
- const char *get_bin_path(void)
- {
-     const char *bin_path = get_variable(KEYWORD_BIN_PATH);
-     // guarantee bin_path is not NULL
-     if (!bin_path) {
-         bin_path = "";
-     }
-     return bin_path;
- }
- const char *get_log_path(void)
- {
-     const char *log_path = get_variable("log_path");
-     // if "log_path" is not exist, make it first.
-     if (!log_path) {
-         char *vms_path = get_variable("vms_path");
-         char *vm_name = get_variable("vm_name");
-         if (!vms_path || !vm_name) {
-             // we can not specify log path.
-             // emulator may not be launched from emulator-manager.
-             log_path = "";
-         }
-         else {
-             log_path = g_strdup_printf("%s/%s/logs", vms_path, vm_name);
-         }
-         set_variable("log_path", log_path, false);
-     }
-     return log_path;
- }
 -#ifdef SUPPORT_LEGACY_ARGS
 -// for compatibility
 -char log_path[PATH_MAX] = { 0, };
 -#endif
--
  /* sdl bits per pixel */
  void set_emul_sdl_bpp(int bpp)
  {
@@@ -423,34 -350,123 +342,118 @@@ bool get_emul_cpu_accel(void
      return false;
  }
  
- /* VM ram size */
- void set_emul_ram_size(const char *size)
- {
-     _emul_info.vm_ram_size = size;
- }
+ //
+ // cleaned-up
+ //
  
- const char* get_emul_ram_size(void)
+ // launch_conf_path
+ // only set by emulator.c when start up
+ const char *launch_conf_file = NULL;
+ // bin path
+ // only set by osutil-{OS}.c when start up
+ const char *bin_path = NULL;
+ const char *get_bin_path(void)
  {
-     return _emul_info.vm_ram_size;
+     if (bin_path) {
+         return bin_path;
+     }
+     return "";
  }
  
- /* file sharing path */
- void set_emul_file_sharing_path(const char *path)
+ // emulator kernel log file
+ static const char *kernel_log_redirect_file = NULL;
+ const char *get_kernel_log_redirect_file(void)
  {
-     _emul_info.file_sharing_path = path;
+     // TODO: kernel log path should be aquired from char device.
+     if (kernel_log_redirect_file) {
+         return kernel_log_redirect_file;
+     }
+     char *vms_path = get_variable("vms_path");
+     char *vm_name = get_variable("vm_name");
+     if (!vms_path || !vm_name) {
+         // we can not specify log path.
+         // emulator may not be launched from emulator-manager.
+         kernel_log_redirect_file = g_strdup("");
+     }
+     else {
+         kernel_log_redirect_file =
+             g_strdup_printf("%s/%s/logs/emulator.klog", vms_path, vm_name);
+     }
+     return kernel_log_redirect_file;
  }
  
- const char* get_emul_file_sharing_path(void)
+ // emulator log file
+ static const char *log_redirect_file = NULL;
+ #ifdef CONFIG_WIN32
+ // for checking Windows version
+ extern OSVERSIONINFO osvi;
+ #endif
+ const char *get_log_redirect_file(void)
  {
-     return _emul_info.file_sharing_path;
- }
 -#ifdef SUPPORT_LEGACY_ARGS
 -    if (log_path[0]) {
 -        return log_path;
 -    }
 -#endif
+     int result = -1;
+     char log_filename[PATH_MAX];
  
- //
- // cleaned-up
- //
+     // should we compare stdout(fd/1) and stderr(fd/2) ??
+ #if defined(CONFIG_LINUX)
+     result = readlink("/proc/self/fd/1", log_filename, PATH_MAX);
+     if (result >= 0) {
+         log_filename[result] = '\0';
+     }
+ #elif defined(CONFIG_DARWIN)
+     result = fcntl(STDOUT_FILENO, F_GETPATH, log_filename);
+ #elif defined(CONFIG_WIN32)
+ # if WINVER >= 0x600
+     // works only vista or newer...
+     if (osvi.dwMajorVersion >= 6) {
+         char win32_log_filename_normalized[PATH_MAX];
+         HANDLE handle_stdout = GetStdHandle(STD_OUTPUT_HANDLE);
+         DWORD ret = GetFinalPathNameByHandle(handle_stdout,
+                 win32_log_filename_normalized,
+                 PATH_MAX, FILE_NAME_NORMALIZED);
+         // strip "\\?\"
+         if (ret > 0) {
+             g_stpcpy(log_filename, win32_log_filename_normalized + 4);
+             result = 0;
+         } else {
+             result = -1;
+         }
+     }
+ # endif
+ #endif
+     if (log_redirect_file) {
+         g_free((void *)log_redirect_file);
+     }
  
- // launch_conf_path
- const char *launch_conf_file = NULL;
+     if (result >= 0) {
+         log_redirect_file = g_strdup(log_filename);
+     } else {
+     // fail safe
+         LOG_WARNING("Can not identify log redirection path, "
+                 "We should assume it !!!\n");
+         char *vms_path = get_variable("vms_path");
+         char *vm_name = get_variable("vm_name");
+         if (!vms_path || !vm_name) {
+             // we can not specify log path.
+             // emulator may not be launched from emulator-manager.
+             log_redirect_file = g_strdup("");
+         }
+         else {
+             log_redirect_file =
+                 g_strdup_printf("%s/%s/logs/emulator.log", vms_path, vm_name);
+         }
+     }
+     return log_redirect_file;
+ }
  
  // drive image file
  static const char *drive_image_file = NULL;
@@@ -560,10 -601,19 +588,19 @@@ const char *get_vm_name(void
  
  const char *get_profile_name(void)
  {
 -    return vio_evdi->profile;
 +    return get_variable("profile");
  }
  
- /* GPU virtualization */
+ // host directory sharing path
+ const char* get_host_directory_sharing_path(void)
+ {
+     FsDriverEntry *sharing_entry = get_fsdev_fsentry((char*)DEFAULT_STATIC_HDS_ID);
+     const char *sharing_path = (sharing_entry != NULL ? sharing_entry->path : NULL);
+     return sharing_path;
+ }
+ // GPU virtualization
  static bool gpu_accel_enabled;
  
  bool is_gpu_accel_enabled(void)
index 92baa4b89583f7c867cfcf4f01e282bc9f5e2bf3,fe1a73fff2f4eea14b83488b5674342b4bc364ed..57a321c1518dfbe9577fbfed6777f365e5636f46
@@@ -35,7 -35,9 +35,8 @@@
  
  #include "display/maru_finger.h"
  #include "config-host.h"
+ #include "hw/maru_device_ids.h"
  
 -#define SUPPORT_LEGACY_ARGS
  #define MAX_ADDR_LEN    256
  #define MAX_PORT_LEN    256
  
@@@ -121,10 -121,11 +120,6 @@@ typedef struct EmulatorConfigState 
      bool sdb_connection;
  } EmulatorConfigState;
  
--/* misc */
- char const *get_bin_path(void);
- char const *get_log_path(void);
 -#ifdef SUPPORT_LEGACY_ARGS
 -extern char log_path[];
 -#endif
--
  /* setter */
  void set_emul_win_scale(double scale);
  void set_emul_sdl_bpp(int bpp);
@@@ -195,5 -203,9 +197,6 @@@ int get_display_resolution_height(void)
  void set_skin_enabled(bool enabled);
  bool is_skin_enabled(void);
  #endif
 -#ifdef SUPPORT_LEGACY_ARGS
 -void set_vm_data_path(const char *path);
 -#endif
  
+ void init_emul_state(void);
  #endif /* __EMUL_STATE_H__ */
Simple merge
index 0f7b43a7ce8439f1e692ee90b248ffc1b27c9b4a,a2ef59f1e6cbe60dbb1744b610df9c8fe2c25e1c..2b2006b01750add6b300be53c7c0b32cfc15cabe
@@@ -241,7 -241,11 +241,9 @@@ static void virtio_evdi_realize(DeviceS
  
      vio_evdi->bh = qemu_bh_new(maru_evdi_bh, vio_evdi);
  
 -    if (vio_evdi->profile) {
 -        epi_init();
 -    }
+     qemu_mutex_init(&recv_buf_mutex);
 +    epi_init();
  }
  
  static void virtio_evdi_unrealize(DeviceState *dev, Error **errp)
Simple merge
diff --cc ui/input.c
index 5aa9bb0ce0de9a91a127cf9b5f9a2b8fbbf798f9,5aa9bb0ce0de9a91a127cf9b5f9a2b8fbbf798f9..fbf5bd3b7feab6036b64f110c852e8c026655a58
@@@ -7,6 -7,6 +7,7 @@@
  #include "ui/console.h"
  
  #if defined CONFIG_MARU && defined CONFIG_SPICE && defined CONFIG_LINUX
++# ifdef CONFIG_JAVA_UI
  #include <pthread.h>
  
  extern void maru_hwkey_event(int event_type, int keycode);
@@@ -15,6 -15,6 +16,7 @@@ extern void do_host_kbd_enable(bool on)
  extern void qemu_system_graceful_shutdown_request(unsigned int sec);
  extern void request_close(void);
  void* tizen_close_thread(void* data);
++# endif
  #endif
  
  //#include "tizen/src/debug_ch.h"
@@@ -514,6 -514,6 +516,7 @@@ void qemu_remove_mouse_mode_change_noti
  }
  
  #if defined CONFIG_MARU && defined CONFIG_SPICE && defined CONFIG_LINUX
++# ifdef CONFIG_JAVA_UI
  void hwkey_put_keycode(int type, int keycode)
  {
      if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) {
@@@ -566,6 -566,6 +569,7 @@@ void tizen_close_put_type(int type
          printf("created tizen_close thread\n");
      }
  }
++# endif
  #endif
  
  MouseInfoList *qmp_query_mice(Error **errp)
index cd0cde2400dd537286296f495ed3fdb9c25e4a21,cd0cde2400dd537286296f495ed3fdb9c25e4a21..42b5690e22ed9ebdd345a565b2b54556fe3a6a10
@@@ -98,6 -98,6 +98,7 @@@ static void kbd_leds(void *opaque, int 
  }
  
  #ifdef CONFIG_MARU
++# ifdef CONFIG_JAVA_UI
  /* hwkey bits */
  
  typedef struct QemuSpiceHwkey {
@@@ -199,6 -199,6 +200,7 @@@ static void qemu_get_sdb_port(SpiceSdbP
      printf("%d\n", get_emul_vm_base_port());
      *sdb_port = get_emul_vm_base_port();
  }
++# endif
  #endif
  
  /* mouse bits */