From: Prerna Saxena <prerna@linux.vnet.ibm.com>
To: qemu-devel <qemu-devel@nongnu.org>
Cc: Mahesh <mahesh@linux.vnet.ibm.com>,
Ananth Narayan <ananth@linux.vnet.ibm.com>,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH][Tracing v2] Process -trace using QemuOptsList
Date: Fri, 27 Aug 2010 16:53:15 +0530 [thread overview]
Message-ID: <20100827165315.4cd2a0c9@zephyr> (raw)
[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
next reply other threads:[~2010-08-27 11:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-27 11:23 Prerna Saxena [this message]
2010-08-27 14:10 ` [Qemu-devel] Re: [PATCH][Tracing v2] Process -trace using QemuOptsList Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100827165315.4cd2a0c9@zephyr \
--to=prerna@linux.vnet.ibm.com \
--cc=ananth@linux.vnet.ibm.com \
--cc=mahesh@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).