From: SeokYeon Hwang Date: Mon, 11 May 2015 08:24:26 +0000 (+0900) Subject: emulator: used "drive_image_file" instead of "tizen_target_img_path" X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~62 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=75f9409748754dcf59e725a98017f11f75b500ff;p=sdk%2Femulator%2Fqemu.git emulator: used "drive_image_file" instead of "tizen_target_img_path" Change-Id: I6db0655f1c6b5c84a4360801d920809a7931cfb4 (cherry picked from commit e85a2024d6bbb29c06e986c2e6300a03f929e03a) Signed-off-by: SeokYeon Hwang Signed-off-by: Sooyoung Ha --- diff --git a/tizen/src/ecs/ecs_msg_device.c b/tizen/src/ecs/ecs_msg_device.c index a1b7ad37e5..6647700327 100644 --- a/tizen/src/ecs/ecs_msg_device.c +++ b/tizen/src/ecs/ecs_msg_device.c @@ -85,11 +85,11 @@ static void msgproc_device_ans(ECS_Client* ccli, const char* category, bool succ g_free(ans.category); } -extern char tizen_target_img_path[]; void send_target_image_information(ECS_Client* ccli) { ECS__Master master = ECS__MASTER__INIT; ECS__DeviceAns ans = ECS__DEVICE_ANS__INIT; - int length = strlen(tizen_target_img_path); // ?? + const char *drive_image_file = get_drive_image_file(); + int length = strlen(drive_image_file); // ?? ans.category = (char*) g_malloc(10 + 1); strncpy(ans.category, "info", 10); @@ -105,9 +105,9 @@ void send_target_image_information(ECS_Client* ccli) { ans.data.data = g_malloc(length); ans.data.len = length; - memcpy(ans.data.data, tizen_target_img_path, length); + memcpy(ans.data.data, drive_image_file, length); - LOG_TRACE("data = %s, length = %hu\n", tizen_target_img_path, length); + LOG_TRACE("data = %s, length = %hu\n", drive_image_file, length); } master.type = ECS__MASTER__TYPE__DEVICE_ANS; @@ -408,7 +408,6 @@ bool msgproc_device_req(ECS_Client* ccli, ECS__DeviceReq* msg) msgproc_device_req_tgesture(ccli, msg); } else if (!strcmp(cmd, "info")) { // check to emulator target image path - LOG_TRACE("receive info message %s\n", tizen_target_img_path); send_target_image_information(ccli); } else if (!strcmp(cmd, "hds")) { msgproc_device_req_hds(ccli, msg, cmd); diff --git a/tizen/src/emulator.c b/tizen/src/emulator.c index 2aa8a964a6..4a618ed40b 100644 --- a/tizen/src/emulator.c +++ b/tizen/src/emulator.c @@ -64,7 +64,6 @@ DECLARE_DEBUG_CHANNEL(main); char maru_kernel_cmdline[LEN_MARU_KERNEL_CMDLINE]; char tizen_target_path[PATH_MAX]; -char tizen_target_img_path[PATH_MAX]; int enable_yagl = 0; int enable_spice = 0; diff --git a/tizen/src/emulator_legacy.c b/tizen/src/emulator_legacy.c index 165204309a..17c2a4e589 100644 --- a/tizen/src/emulator_legacy.c +++ b/tizen/src/emulator_legacy.c @@ -37,6 +37,7 @@ #include "build_info.h" #include "emulator.h" +#include "emulator_options.h" #include "emul_state.h" #include "hw/virtio/maru_virtio_touchscreen.h" #include "util/check_gl.h" @@ -72,7 +73,6 @@ MULTI_DEBUG_CHANNEL(qemu, main); extern gchar maru_kernel_cmdline[LEN_MARU_KERNEL_CMDLINE]; extern char tizen_target_path[PATH_MAX]; -extern char tizen_target_img_path[PATH_MAX]; extern int enable_yagl; extern int enable_spice; @@ -148,7 +148,7 @@ static void set_image_and_log_path(char *qemu_argv) } set_emul_vm_name(g_path_get_basename(tizen_target_path)); - strcpy(tizen_target_img_path, path); + set_variable("drive_image_file", path, true); free(path); strcpy(log_path, tizen_target_path); @@ -306,7 +306,7 @@ int legacy_emulator_main(int argc, char * argv[], char **envp) print_system_info(); INFO("Prepare running...\n"); - INFO("tizen_target_img_path: %s\n", tizen_target_img_path); + INFO("drive_image_flle: %s\n", get_drive_image_file()); int i; fprintf(stdout, "qemu args: =========================================\n"); diff --git a/tizen/src/util/osutil-darwin.c b/tizen/src/util/osutil-darwin.c index 9c86f1efb5..dd71eaf46a 100644 --- a/tizen/src/util/osutil-darwin.c +++ b/tizen/src/util/osutil-darwin.c @@ -57,8 +57,6 @@ MULTI_DEBUG_CHANNEL(qemu, osutil); static int g_shmid; static CFDictionaryRef proxySettings; -extern char tizen_target_img_path[]; - static char *cfstring_to_cstring(CFStringRef str) { if (str == NULL) { return NULL; @@ -104,7 +102,7 @@ void make_vm_lock_os(void) perror("osutil-darwin: "); return; } - g_sprintf(shared_memory, "%s", tizen_target_img_path); + g_sprintf(shared_memory, "%s", get_drive_image_file()); INFO("shared memory key: %d, value: %s\n", base_port, (char *)shared_memory); if (shmdt(shared_memory) == -1) { diff --git a/tizen/src/util/osutil-linux.c b/tizen/src/util/osutil-linux.c index a84379c791..474c037f7b 100644 --- a/tizen/src/util/osutil-linux.c +++ b/tizen/src/util/osutil-linux.c @@ -62,8 +62,6 @@ static int g_shmid; static char *g_shared_memory; static int gproxytool = GSETTINGS; -extern char tizen_target_img_path[]; - /* Getting proxy commands */ static const char* gproxycmds[][2] = { { "gconftool-2 -g /system/proxy/mode" , "gsettings get org.gnome.system.proxy mode" }, @@ -100,7 +98,7 @@ void check_vm_lock_os(void) INFO("count of process that use shared memory : %d\n", shm_info.shm_nattch); if ((shm_info.shm_nattch > 0) && - g_strcmp0(tizen_target_img_path, (char *)shm_addr) == 0) { + g_strcmp0(get_drive_image_file(), (char *)shm_addr) == 0) { if (check_port_bind_listen(port + 1) > 0) { shmdt(shm_addr); continue; @@ -138,7 +136,7 @@ void make_vm_lock_os(void) return; } - g_sprintf(g_shared_memory, "%s", tizen_target_img_path); + g_sprintf(g_shared_memory, "%s", get_drive_image_file()); INFO("shared memory key: %d value: %s\n", base_port, (char *)g_shared_memory); diff --git a/tizen/src/util/osutil-win32.c b/tizen/src/util/osutil-win32.c index b71f0ef5d5..0a55dc03ba 100644 --- a/tizen/src/util/osutil-win32.c +++ b/tizen/src/util/osutil-win32.c @@ -54,7 +54,6 @@ MULTI_DEBUG_CHANNEL (emulator, osutil); static HANDLE g_hMapFile; static char *g_pBuf; -extern char tizen_target_img_path[]; static char g_sdcard[256] = {0,}; static sdcard_info info; static const char *pactempfile = ".autoproxy"; @@ -79,7 +78,7 @@ void check_vm_lock_os(void) CloseHandle(hMapFile); } - if (strcmp(pBuf, tizen_target_img_path) == 0) { + if (strcmp(pBuf, get_drive_image_file()) == 0) { maru_register_exit_msg(MARU_EXIT_UNKNOWN, "Can not execute this VM.\n" "The same name is running now."); @@ -104,7 +103,7 @@ void make_vm_lock_os(void) int base_port; base_port = get_emul_vm_base_port(); - shared_memory = g_strdup_printf("%s", tizen_target_img_path); + shared_memory = g_strdup_printf("%s", get_drive_image_file()); port_in_use = g_strdup_printf("%d", base_port); g_hMapFile = CreateFileMapping( INVALID_HANDLE_VALUE, /* use paging file */