qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH][Tracing v2] Process -trace using QemuOptsList
@ 2010-08-27 11:23 Prerna Saxena
  2010-08-27 14:10 ` [Qemu-devel] " Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Prerna Saxena @ 2010-08-27 11:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: Mahesh, Ananth Narayan, Stefan Hajnoczi

[PATCH] Add -trace file FILENAME switch to qemu startup command.
 This processes the argument using QemuOptsList


Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com>
---
 qemu-config.c |   18 ++++++++++++++++++
 qemu-config.h |    3 +++
 vl.c          |    5 ++++-
 3 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/qemu-config.c b/qemu-config.c
index 95abe61..9106511 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -294,6 +294,21 @@ QemuOptsList qemu_mon_opts = {
     },
 };
 
+#ifdef CONFIG_SIMPLE_TRACE
+QemuOptsList qemu_trace_opts = {
+    .name = "trace",
+    .implied_opt_name = "trace",
+    .head = QTAILQ_HEAD_INITIALIZER(qemu_trace_opts.head),
+    .desc = {
+        {
+            .name = "file",
+            .type = QEMU_OPT_STRING,
+        },
+        { /* end if list */ }
+    },
+};
+#endif
+
 QemuOptsList qemu_cpudef_opts = {
     .name = "cpudef",
     .head = QTAILQ_HEAD_INITIALIZER(qemu_cpudef_opts.head),
@@ -352,6 +367,9 @@ static QemuOptsList *vm_config_groups[] = {
     &qemu_global_opts,
     &qemu_mon_opts,
     &qemu_cpudef_opts,
+#ifdef CONFIG_SIMPLE_TRACE
+    &qemu_trace_opts,
+#endif
     NULL,
 };
 
diff --git a/qemu-config.h b/qemu-config.h
index dca69d4..4db2fb5 100644
--- a/qemu-config.h
+++ b/qemu-config.h
@@ -14,6 +14,9 @@ extern QemuOptsList qemu_rtc_opts;
 extern QemuOptsList qemu_global_opts;
 extern QemuOptsList qemu_mon_opts;
 extern QemuOptsList qemu_cpudef_opts;
+#ifdef CONFIG_SIMPLE_TRACE
+extern QemuOptsList qemu_trace_opts;
+#endif
 
 QemuOptsList *qemu_find_opts(const char *group);
 int qemu_set_option(const char *str);
diff --git a/vl.c b/vl.c
index 99664e9..0ff04e9 100644
--- a/vl.c
+++ b/vl.c
@@ -2599,7 +2599,10 @@ int main(int argc, char **argv, char **envp)
                 break;
 #ifdef CONFIG_SIMPLE_TRACE
             case QEMU_OPTION_trace:
-                trace_file = optarg;
+                opts = qemu_opts_parse(&qemu_trace_opts, optarg, 0);
+                if (opts) {
+                    trace_file = qemu_opt_get(opts, "file");
+                }
                 break;
 #endif
             case QEMU_OPTION_readconfig:
-- 
1.7.2.1



-- 
Prerna Saxena

Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Qemu-devel] Re: [PATCH][Tracing v2] Process -trace using QemuOptsList
  2010-08-27 11:23 [Qemu-devel] [PATCH][Tracing v2] Process -trace using QemuOptsList Prerna Saxena
@ 2010-08-27 14:10 ` Stefan Hajnoczi
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2010-08-27 14:10 UTC (permalink / raw)
  To: Prerna Saxena; +Cc: Mahesh, Ananth Narayan, qemu-devel

On Fri, Aug 27, 2010 at 04:53:15PM +0530, Prerna Saxena wrote:
> [PATCH] Add -trace file FILENAME switch to qemu startup command.
>  This processes the argument using QemuOptsList
> 
> 
> Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com>

Thanks, I will merge this for tracing v2.

Stefan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-27 14:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-27 11:23 [Qemu-devel] [PATCH][Tracing v2] Process -trace using QemuOptsList Prerna Saxena
2010-08-27 14:10 ` [Qemu-devel] " Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).