diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2016-01-28 13:11:04 -0200 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2016-05-20 14:28:54 -0300 |
commit | 16714b16806979d7f9f245b2b4c13966e4fa1c2e (patch) | |
tree | 91e71a1b4331bead2b77d37bb4c3b09664d12c57 /vl.c | |
parent | 1f0dfe02d47b14b04f2643828e2ee11665e1eb24 (diff) |
vl: Simplify global property registration
There's no need to use qdev_prop_register_global_list() and an
array, if we are registering a single GlobalProperty struct. Use
qdev_prop_register_global() instead.
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 39 |
1 files changed, 15 insertions, 24 deletions
@@ -888,16 +888,13 @@ 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", - }, - { /* end of list */ } + static GlobalProperty slew_lost_ticks = { + .driver = "mc146818rtc", + .property = "lost_tick_policy", + .value = "slew", }; - qdev_prop_register_global_list(slew_lost_ticks); + qdev_prop_register_global(&slew_lost_ticks); } else if (!strcmp(value, "none")) { /* discard is default */ } else { @@ -3626,16 +3623,13 @@ int main(int argc, char **argv, char **envp) win2k_install_hack = 1; break; case QEMU_OPTION_rtc_td_hack: { - static GlobalProperty slew_lost_ticks[] = { - { - .driver = "mc146818rtc", - .property = "lost_tick_policy", - .value = "slew", - }, - { /* end of list */ } + static GlobalProperty slew_lost_ticks = { + .driver = "mc146818rtc", + .property = "lost_tick_policy", + .value = "slew", }; - qdev_prop_register_global_list(slew_lost_ticks); + qdev_prop_register_global(&slew_lost_ticks); break; } case QEMU_OPTION_acpitable: @@ -3682,18 +3676,15 @@ int main(int argc, char **argv, char **envp) break; } case QEMU_OPTION_no_kvm_pit_reinjection: { - static GlobalProperty kvm_pit_lost_tick_policy[] = { - { - .driver = "kvm-pit", - .property = "lost_tick_policy", - .value = "discard", - }, - { /* end of list */ } + static GlobalProperty kvm_pit_lost_tick_policy = { + .driver = "kvm-pit", + .property = "lost_tick_policy", + .value = "discard", }; error_report("warning: deprecated, replaced by " "-global kvm-pit.lost_tick_policy=discard"); - qdev_prop_register_global_list(kvm_pit_lost_tick_policy); + qdev_prop_register_global(&kvm_pit_lost_tick_policy); break; } case QEMU_OPTION_usb: |