[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v2 06/39] vl.c: Use qdev_prop_register_global() for si
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [RFC v2 06/39] vl.c: Use qdev_prop_register_global() for single globals |
Date: |
Fri, 13 Jun 2014 16:43:45 -0300 |
Instead of using an array when registeting a single global, simply call
qdev_prop_register().
Signed-off-by: Eduardo Habkost <address@hidden>
---
vl.c | 39 +++++++++++++++------------------------
1 file changed, 15 insertions(+), 24 deletions(-)
diff --git a/vl.c b/vl.c
index 5e77a27..8d3d2a6 100644
--- a/vl.c
+++ b/vl.c
@@ -812,16 +812,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 {
@@ -3697,16 +3694,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:
@@ -3748,18 +3742,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",
};
fprintf(stderr, "Warning: option deprecated, use "
"lost_tick_policy property of kvm-pit instead.\n");
- qdev_prop_register_global_list(kvm_pit_lost_tick_policy);
+ qdev_prop_register_global(&kvm_pit_lost_tick_policy);
break;
}
case QEMU_OPTION_usb:
--
1.9.0
- [Qemu-devel] [RFC v2 00/39] Convert PC machine-types to QOM classes, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 01/39] q35: Use PC_Q35_COMPAT_1_4 on pc-q35-1.4 compat_props, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 03/39] piix: Move pc-0.13 virtio-9p-pci compat to PC_COMPAT_0_13, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 02/39] piix: Move pc-0.14 qxl compat properties to PC_COMPAT_0_14, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 05/39] piix: Move pc-0.11 drive version compat props TO PC_COMPAT_0_11, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 06/39] vl.c: Use qdev_prop_register_global() for single globals,
Eduardo Habkost <=
- [Qemu-devel] [RFC v2 07/39] machine: Make compat_props a linked list, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 08/39] pc: Register machine classes directly instead of using QEMUMachine, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 10/39] pc: Eliminate pc_default_machine_options(), Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 09/39] pc: Eliminate pc_common_machine_options(), Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 11/39] piix: Eliminate pc_i440fx_machine_options(), Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 13/39] q35: Eliminate pc_q35_1_4_machine_options(), Eduardo Habkost, 2014/06/13