summaryrefslogtreecommitdiff
path: root/tizen/src/emulator.c
diff options
context:
space:
mode:
Diffstat (limited to 'tizen/src/emulator.c')
-rw-r--r--tizen/src/emulator.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/tizen/src/emulator.c b/tizen/src/emulator.c
index b1d6bab6c8..b63d020518 100644
--- a/tizen/src/emulator.c
+++ b/tizen/src/emulator.c
@@ -47,7 +47,10 @@
#include "ecs/ecs.h"
#include "util/device_hotplug.h"
#include "util/exported_strings.h"
-
+#ifdef CONFIG_WIN32
+#include <windows.h>
+#include <sddl.h>
+#endif
#ifdef CONFIG_QT
#include <qt5_supplement.h>
#endif
@@ -240,7 +243,6 @@ const char *prepare_maru(const char * const kernel_cmdline)
void prepare_maru_after_device_init(void)
{
- make_vm_lock_os();
init_device_hotplug();
start_ecs();
@@ -283,7 +285,10 @@ static int emulator_main(int argc, char *argv[], char **envp)
set_variable(argv[optind - 1], argv[optind], true);
break;
case 'c':
- launch_conf_file = g_strdup(optarg);
+ if (optind == 3) {
+ // "--conf" should be a first argument
+ launch_conf_file = g_strdup(optarg);
+ }
break;
case 'q':
c = -1;
@@ -295,8 +300,12 @@ static int emulator_main(int argc, char *argv[], char **envp)
}
if (!launch_conf_file && qemu_arg_index == 0) {
- fprintf(stderr, "Usage: %s {-c|--conf} conf_file ...\n",
- basename(argv[0]));
+ char *executable = basename(argv[0]);
+ fprintf(stderr, "Usage: %s {-c|--conf} conf_file [--<key> <value>]...\n"
+ " %*s [{-q|--qemu} <QEMU_ARGS>...]\n",
+ executable, (int)strlen(executable), "");
+ fprintf(stderr, " %s {-q|--qemu} <QEMU_ARGS>...\n",
+ executable);
return -1;
}
@@ -308,6 +317,12 @@ static int emulator_main(int argc, char *argv[], char **envp)
set_bin_path_os(_qemu_argv[0]);
if (launch_conf_file) {
+ if (!g_file_test(launch_conf_file, G_FILE_TEST_EXISTS)) {
+ fprintf(stderr, "conf_file(%s) does not exist.\n", launch_conf_file);
+ return -1;
+ }
+
+ make_vm_lock_os(g_path_get_dirname(launch_conf_file));
if (!load_conf(launch_conf_file)) {
return -1;
}
@@ -346,6 +361,15 @@ int main(int argc, char *argv[], char **envp)
init_error_handler();
return emulator_main(argc, argv, envp);
}
+#elif defined (CONFIG_WIN32)
+int main(int argc, char *argv[])
+{
+ if (!check_integrity_level_and_respawn()) {
+ init_error_handler();
+ return emulator_main(argc, argv, NULL);
+ }
+ return 0;
+}
#else
int main(int argc, char *argv[])
{