diff options
author | SeokYeon Hwang <syeon.hwang@samsung.com> | 2015-10-22 15:19:47 +0900 |
---|---|---|
committer | SeokYeon Hwang <syeon.hwang@samsung.com> | 2015-10-23 16:21:48 +0900 |
commit | bb6bd831649c2de2416853a6dd7532c8990fb4e0 (patch) | |
tree | 918ef54a85aa93290d9e3dc0473b45ae7a434697 /util | |
parent | 3bd9e954868ce92dea87ebf6d14d743cfa278a7c (diff) | |
download | qemu-bb6bd831649c2de2416853a6dd7532c8990fb4e0.tar.gz qemu-bb6bd831649c2de2416853a6dd7532c8990fb4e0.tar.bz2 qemu-bb6bd831649c2de2416853a6dd7532c8990fb4e0.zip |
error: use new qt5 dialog instead of legacy java dialog
Change-Id: I3682bd91063ffe2393207ed9c6a7d2d4d003a46c
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
Diffstat (limited to 'util')
-rw-r--r-- | util/oslib-posix.c | 25 | ||||
-rw-r--r-- | util/oslib-win32.c | 46 |
2 files changed, 8 insertions, 63 deletions
diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 6b69162498..997f24d21b 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -58,6 +58,7 @@ extern int daemon(int, int); #include "sysemu/sysemu.h" #include "trace.h" #include "qemu/sockets.h" +#include "qemu/error-report.h" #include <sys/mman.h> #include <libgen.h> #include <setjmp.h> @@ -92,28 +93,10 @@ int qemu_daemon(int nochdir, int noclose) void *qemu_oom_check(void *ptr) { -#ifdef CONFIG_MARU - const char _msg[] = "Failed to allocate memory in qemu."; - char cmd[JAVA_MAX_COMMAND_LENGTH] = { 0, }; - int len; -#endif - if (ptr == NULL) { - fprintf(stderr, "Failed to allocate memory: %s\n", strerror(errno)); -#ifdef CONFIG_MARU - len = strlen(JAVA_EXEFILE_PATH) + strlen(JAVA_EXEOPTION) + - strlen(JAR_SKINFILE) + strlen(JAVA_SIMPLEMODE_OPTION) + - strlen(_msg) + 7; - if (len > JAVA_MAX_COMMAND_LENGTH) { - len = JAVA_MAX_COMMAND_LENGTH; - } - - snprintf(cmd, len, "%s %s %s %s=\"%s\"", - JAVA_EXEFILE_PATH, JAVA_EXEOPTION, JAR_SKINFILE, JAVA_SIMPLEMODE_OPTION, _msg); - if (system(cmd) == -1) { - fprintf(stderr, "failed to execute this command: %s\n", cmd); - } -#endif +// CONFIG_MARU MODIFICATION + //fprintf(stderr, "Failed to allocate memory: %s\n", strerror(errno)); + error_report("Failed to allocate memory: %s", strerror(errno)); abort(); } return ptr; diff --git a/util/oslib-win32.c b/util/oslib-win32.c index 520f2fac7e..de9fd7e288 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -37,6 +37,7 @@ #include "qemu/main-loop.h" #include "trace.h" #include "qemu/sockets.h" +#include "qemu/error-report.h" /* this must come after including "trace.h" */ #include <shlobj.h> @@ -151,49 +152,10 @@ bool get_java_path(char **java_path) void *qemu_oom_check(void *ptr) { -#ifdef CONFIG_MARU - const char _msg[] = "Failed to allocate memory in qemu."; - char cmd[JAVA_MAX_COMMAND_LENGTH] = { 0, }; - char *JAVA_EXEFILE_PATH = NULL; - int len, ret; -#endif - if (ptr == NULL) { - fprintf(stderr, "Failed to allocate memory: %lu\n", GetLastError()); -#ifdef CONFIG_MARU - JAVA_EXEFILE_PATH = malloc(JAVA_MAX_COMMAND_LENGTH); - if (!JAVA_EXEFILE_PATH) { - // TODO: print error message. - return ptr; - } - - memset(JAVA_EXEFILE_PATH, 0, JAVA_MAX_COMMAND_LENGTH); - if (is_wow64()) { - if (!get_java_path(&JAVA_EXEFILE_PATH)) { - strcpy(JAVA_EXEFILE_PATH, "java"); - } - } else { - strcpy(JAVA_EXEFILE_PATH, "java"); - } - len = strlen(JAVA_EXEFILE_PATH) + strlen(JAVA_EXEOPTION) + - strlen(JAR_SKINFILE) + strlen(JAVA_SIMPLEMODE_OPTION) + - strlen(_msg) + 7; - if (len > JAVA_MAX_COMMAND_LENGTH) { - len = JAVA_MAX_COMMAND_LENGTH; - } - - snprintf(cmd, len, "%s %s %s %s=\"%s\"", - JAVA_EXEFILE_PATH, JAVA_EXEOPTION, JAR_SKINFILE, - JAVA_SIMPLEMODE_OPTION, _msg); - ret = WinExec(cmd, SW_SHOW); - if (ret < 32) { - // TODO: error handling... - } - - /* for 64bit windows */ - free(JAVA_EXEFILE_PATH); - JAVA_EXEFILE_PATH=0; -#endif +// CONFIG_MARU MODIFICATION + //fprintf(stderr, "Failed to allocate memory: %lu\n", GetLastError()); + error_report("Failed to allocate memory: %lu", GetLastError()); abort(); } return ptr; |