diff mbox

[v2,05/14] cmdline: implement -localtime with QemuOpts

Message ID 1334180081-6172-6-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini April 11, 2012, 9:34 p.m. UTC
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 <pbonzini@redhat.com>
---
 qemu-config.c |    1 +
 vl.c          |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)
diff mbox

Patch

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;