]> git.proxmox.com Git - qemu.git/commitdiff
linux-user/main.c: Add option to user-mode emulation so that user can specify log...
author陳韋任 <chenwj@iis.sinica.edu.tw>
Tue, 8 Nov 2011 09:46:44 +0000 (17:46 +0800)
committerRiku Voipio <riku.voipio@linaro.org>
Thu, 2 Feb 2012 15:51:20 +0000 (17:51 +0200)
  QEMU linux user-mode's default log file name is "/tmp/qemu.log". In order to
change the log file name, user need to modify the source code then recompile
QEMU. This patch allow user use "-D logfile" option to specify the log file
name.

Signed-off-by: Chen Wen-Ren <chenwj@iis.sinica.edu.tw>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user/main.c

index 64d2208a089e3918cb7d37ac0d50b8891143cf41..14bf5f0bc798011cbc9e416c3493dee823998db6 100644 (file)
@@ -2945,6 +2945,11 @@ static void handle_arg_log(const char *arg)
     cpu_set_log(mask);
 }
 
+static void handle_arg_log_filename(const char *arg)
+{
+    cpu_set_log_filename(arg);
+}
+
 static void handle_arg_set_env(const char *arg)
 {
     char *r, *p, *token;
@@ -3125,6 +3130,8 @@ struct qemu_argument arg_table[] = {
 #endif
     {"d",          "QEMU_LOG",         true,  handle_arg_log,
      "options",    "activate log"},
+    {"D",          "QEMU_LOG_FILENAME", true, handle_arg_log_filename,
+     "logfile",     "override default logfile location"},
     {"p",          "QEMU_PAGESIZE",    true,  handle_arg_pagesize,
      "pagesize",   "set the host page size to 'pagesize'"},
     {"singlestep", "QEMU_SINGLESTEP",  false, handle_arg_singlestep,