From 1fff3c206f320104e929b22e6b9e82fc6e4c2ae6 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 13 Nov 2019 13:33:44 +0100 Subject: qom: introduce object_register_sugar_prop Similar to the existing "-rtc driftfix" option, we will convert some legacy "-machine" command line options to global properties on accelerators. Because accelerators are not devices, we cannot use qdev_prop_register_global. Instead, provide a slot in the generic object_compat_props arrays for command line syntactic sugar. Signed-off-by: Paolo Bonzini --- vl.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index c350eef046..b95c161c1d 100644 --- a/vl.c +++ b/vl.c @@ -895,13 +895,9 @@ static void configure_rtc(QemuOpts *opts) value = qemu_opt_get(opts, "driftfix"); if (value) { if (!strcmp(value, "slew")) { - static GlobalProperty slew_lost_ticks = { - .driver = "mc146818rtc", - .property = "lost_tick_policy", - .value = "slew", - }; - - qdev_prop_register_global(&slew_lost_ticks); + object_register_sugar_prop("mc146818rtc", + "lost_tick_policy", + "slew"); } else if (!strcmp(value, "none")) { /* discard is default */ } else { -- cgit v1.2.3