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>
Fri, 12 Jun 2015 10:05:57 +0000 (19:05 +0900)
Removed "--profile" argument. It is not necessary anymore.

Change-Id: Ie0f93d44b4548c325bf5a87b44a0f9759164538a
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
(cherry picked from commit 92b19938f596a08107ddc2f00b3188958052bae7)
Signed-off-by: Sooyoung Ha <yoosah.ha@samsung.com>
tizen/src/emulator.c
tizen/src/emulator_options.c
tizen/src/emulator_options.h

index 3f4f29ac61f29b611c9b4d5013ca95aca257edca..bfc189b39a1934043f6a188fcbf8ca89aaf2c569 100644 (file)
@@ -332,7 +332,6 @@ static int emulator_main(int argc, char *argv[], char **envp)
     }
 #endif
 
-    gchar *profile = NULL;
     gchar *conf = NULL;
 
     int c = 0;
@@ -347,7 +346,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   }
         };
@@ -365,10 +363,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);
@@ -379,21 +373,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(_qemu_argv[0]);
 
-    if (!load_profile_default(conf, profile)) {
+    if (!load_conf(conf)) {
         return -1;
     }
 
@@ -418,7 +411,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 638818313e71ae675cab8812cd466a0282b630d2..cd47a77c6e6237d6dc01f4d99016a0a7380c68fb 100644 (file)
@@ -27,6 +27,7 @@
  */
 
 #include <string.h>
+#include <assert.h>
 #include "qemu/queue.h"
 
 #include "emulator_options.h"
@@ -172,7 +173,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);
@@ -197,18 +198,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 = 0;
     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");
@@ -344,7 +343,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 ee9a8989068d5b90807f0d173ed4c32797af2e5d..58f7867af741a19e9aa074729938f9a6887bd64a 100644 (file)
@@ -34,8 +34,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__ */