qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 05/14] cmdline: implement -localtime with QemuOpt


From: Paolo Bonzini
Subject: [Qemu-devel] [PATCH v2 05/14] cmdline: implement -localtime with QemuOpts
Date: Wed, 11 Apr 2012 23:34:32 +0200

The -localtime option already has a QemuOpts equivalent.  Setting
the merge_lists option on the -rtc list makes it simple to use it.

This includes a small change in behavior for -rtc.  For example, "-rtc
base=localtime -rtc driftfix=slew" will actually combine the option
rather than override them.  These are actually nicer semantics than
what was there so far.

Signed-off-by: Paolo Bonzini <address@hidden>
---
 qemu-config.c |    1 +
 vl.c          |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/qemu-config.c b/qemu-config.c
index 89706df..8f0923e 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -327,6 +327,7 @@ static QemuOptsList qemu_net_opts = {
 
 static QemuOptsList qemu_rtc_opts = {
     .name = "rtc",
+    .merge_lists = true,
     .head = QTAILQ_HEAD_INITIALIZER(qemu_rtc_opts.head),
     .desc = {
         {
diff --git a/vl.c b/vl.c
index eb0eee7..7f537be 100644
--- a/vl.c
+++ b/vl.c
@@ -2684,7 +2684,7 @@ int main(int argc, char **argv, char **envp)
                keyboard_layout = optarg;
                break;
             case QEMU_OPTION_localtime:
-                rtc_utc = 0;
+                qemu_opts_parse(qemu_find_opts("rtc"), "base=localtime", 0);
                 break;
             case QEMU_OPTION_vga:
                 vga_model = optarg;
-- 
1.7.9.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]