Skip to contentSkip to conversation

linux-user/main.c: Add option to user-mode emulation so that user can specify log file name

PATCH In review 陳韋任 2 participants 2 messages Nov 8, 2011

lore
Share & tools
lore

陳韋任

author
#0 lore raw

PATCH 1/1 linux-user/main.c: Add option to user-mode emulation so that user can specify log file name

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.

---
 linux-user/main.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
linux-user/main.c +7 -0
index d1bbc57..95d689e 100644
@@ -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,
Signature · 1 line
1.7.3.4
#1 lore raw
Quoted 37 lines · 陳韋任

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.

---
 linux-user/main.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
linux-user/main.c +7 -0
index d1bbc57..95d689e 100644
@@ -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,
Signature · 1 line
1.7.3.4

CCing this patch onto [email protected].

Stefan