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 <pbonz...@redhat.com> --- 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 54c5d79..3b9ff31 100644 --- a/vl.c +++ b/vl.c @@ -2689,7 +2689,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.7.6