emulator: removed "--profile" argument
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Thu, 28 May 2015 07:44:49 +0000 (16:44 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Thu, 28 May 2015 08:29:14 +0000 (17:29 +0900)
Removed "--profile" argument. It is not necessary anymore.

Change-Id: Ie0f93d44b4548c325bf5a87b44a0f9759164538a
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
tizen/src/emulator.c
tizen/src/emulator_options.c
tizen/src/emulator_options.h

index de6cc8d3e350dce2686463f43aa4fc5447e86621..fd78b8d64d15de9ca0b2297877ed510eeddf5675 100644 (file)
@@ -315,7 +315,6 @@ static int emulator_main(int argc, char *argv[], char **envp)
     }
 #endif
 
-    gchar *profile = NULL;
     gchar *conf = NULL;
 
     int c = 0;
@@ -330,7 +329,6 @@ static int emulator_main(int argc, char *argv[], char **envp)
     while (c != -1) {
         static struct option long_options[] = {
             {"conf",        required_argument,  0,  'c' },
-            {"profile",     required_argument,  0,  'p' },
             {"additional",  required_argument,  0,  'a' },
             {0,             0,                  0,  0   }
         };
@@ -348,10 +346,6 @@ static int emulator_main(int argc, char *argv[], char **envp)
             set_variable("conf", optarg, true);
             conf = g_strdup(optarg);
             break;
-        case 'p':
-            set_variable("profile", optarg, true);
-            profile = g_strdup(optarg);
-            break;
         case 'a':
             // TODO: additional options should be accepted
             set_variable("additional", optarg, true);
@@ -362,21 +356,20 @@ static int emulator_main(int argc, char *argv[], char **envp)
         }
     }
 
-    if (!profile && !conf) {
-        fprintf(stderr, "Usage: %s {-c|--conf} conf_file ...\n"
-                        "       %s {-p|--profile} profile ...\n",
-                        basename(argv[0]), basename(argv[0]));
+    if (!conf) {
+        fprintf(stderr, "Usage: %s {-c|--conf} conf_file ...\n",
+                        basename(argv[0]));
 
         return -1;
     }
 
-    // load profile configurations
+    // load configurations
     _qemu_argc = 0;
     _qemu_argv[_qemu_argc++] = g_strdup(argv[0]);
 
     set_bin_path_os(_qemu_argv[0]);
 
-    if (!load_profile_default(conf, profile)) {
+    if (!load_conf(conf)) {
         return -1;
     }
 
@@ -401,7 +394,7 @@ static int emulator_main(int argc, char *argv[], char **envp)
     }
 
     // assemble arguments for qemu and skin
-    if (!assemble_profile_args(&_qemu_argc, _qemu_argv,
+    if (!assemble_emulator_args(&_qemu_argc, _qemu_argv,
                         &_skin_argc, _skin_argv)) {
         return -1;
     }
index d1f159114e199932e6e587fe59bb7581d56fb56b..9926061b56c9de5b6c51d606898eea87fea92676 100644 (file)
@@ -27,6 +27,7 @@
  */
 
 #include <string.h>
+#include <assert.h>
 #include "qemu/queue.h"
 
 #include "emulator_options.h"
@@ -183,7 +184,7 @@ static char *substitute_variables(char *src)
             if(!value) {
                 fprintf(stderr, "[%s] is not set."
                         " Please input value using commandline argument"
-                        " \"--%s\" or profile default file or envirionment"
+                        " \"--%s\" or conf file or envirionment"
                         " variable.\n", name, name);
                 value = (char *)"";
                 set_variable(name, value, false);
@@ -208,18 +209,16 @@ static char *substitute_variables(char *src)
     return str;
 }
 
-bool load_profile_default(const char * const conf, const char * const profile)
+bool load_conf(const char * const conf)
 {
     int classification = -1;
     char str[LINE_LIMIT];
     char *filename;
     FILE *file = NULL;
 
-    // if "conf" is exist, ignore "profile"
+    assert(!!conf);
     if (conf) {
         filename = g_strdup(conf);
-    } else {
-        filename = g_strdup_printf("%s/%s.conf", get_bin_path(), profile);
     }
 
     file = fopen(filename, "r");
@@ -362,7 +361,7 @@ static bool assemble_args(int *argc, char **argv,
     return true;
 }
 
-bool assemble_profile_args(int *qemu_argc, char **qemu_argv,
+bool assemble_emulator_args(int *qemu_argc, char **qemu_argv,
         int *skin_argc, char **skin_argv)
 {
     if (!assemble_args(qemu_argc, qemu_argv,
index 1ac865850b70114e26cb6df12f4afe9ddb8b49f5..f3d3a4694559dc4a295f0b631c0813ec37fd7440 100644 (file)
@@ -36,8 +36,8 @@
 void set_variable(const char * const arg1, const char * const arg2, bool override);
 char *get_variable(const char * const name);
 void reset_variables(void);
-bool load_profile_default(const char * const conf, const char * const profile);
-bool assemble_profile_args(int *qemu_argc, char **qemu_argv,
+bool load_conf(const char * const conf);
+bool assemble_emulator_args(int *qemu_argc, char **qemu_argv,
         int *skin_argc, char **skin_argv);
 
 #endif /* __EMULATOR_OPTIONS_H__ */