New version, rebased to latest qemu.git master. Git tree: https://github.com/ehabkost/qemu-hacks/tree/pc-machine-class.v3
I would like to get this discussed/reviewed before QEMU 2.1.0 is released, so we can be ready to include the series as soon as we start 2.2 development. My goal is that _all_ PC machine-types should be declared using only a class_init + TypeInfo pair, and nothing else. The compat_func field on PCMachineClass is supposed to be temporary, until we manage to eliminate all pc_compat_*() functions. The only obstacle for that are the CPUID compat stuff inside some pc_compat_*() functions. I will submit a series for that later, including X86CPU feature properties. Eduardo Habkost (35): pc_piix: Add missing compat code to pc-0.1[0123] target-i385: Add kvmclock_enabled static pc_piix: Reuse pc_compat_1_2() on pc_init_pci_no_kvmclock() pc: Replace tabs with spaces on pc.h vl.c: Use qdev_prop_register_global() for single globals piix: Move pc-0.14 qxl compat properties to PC_COMPAT_0_14 piix: Move pc-0.13 virtio-9p-pci compat to PC_COMPAT_0_13 piix: Move pc-0.1[23] rombar compat props to PC_COMPAT_0_13 piix: Move pc-0.11 drive version compat props TO PC_COMPAT_0_11 machine: Make compat_props a linked list pc: Register machine classes directly instead of using QEMUMachine pc: Eliminate pc_common_machine_options() pc: Eliminate pc_default_machine_options() piix: Eliminate pc_i440fx_machine_options() q35: Eliminate pc_q35_machine_options() q35: Eliminate pc_q35_1_4_machine_options() pc: Eliminate all *_machine_options() functions machine: Eliminate QEMUMachine.compat_props pc: Rename pc_machine variable to pcms pc: Move pci_enabled parameter to PCMachineClass q35: Use PCMachineClass.pci_enabled field pc: Move kvmclock_enabled to PCMachineClass pc: Move smbios_legacy_mode to PCMachineClass pc: Move smbios_defaults to PCMachineClass pc: Move has_acpi_build to PCMachineClass pc: Move has_pci_info to PCMachineClass pc: Move gigabyte_align to PCMachineClass pc: Move has_reserved_memory to PCMachineClass pc: Move option_rom_has_mr/rom_file_has_mr to MachineClass piix: Eliminate pc_init_pci() piix: Introduce struct PCI440FXMachineClass pc: Create common machine init function pc: Eliminate empty or trivial compat functions piix: Move compat/init functions closer to corresponding class_init pc: Move {ram,pci,rom}_memory variables to PCMachineState hw/core/loader.c | 12 +- hw/core/machine.c | 16 + hw/core/qdev-properties.c | 9 +- hw/i386/pc.c | 71 ++-- hw/i386/pc_piix.c | 805 +++++++++++++++++++++++-------------------- hw/i386/pc_q35.c | 282 ++++++++------- include/hw/boards.h | 13 +- include/hw/i386/pc.h | 46 +-- include/hw/qdev-core.h | 2 + include/hw/qdev-properties.h | 2 +- vl.c | 44 +-- 11 files changed, 677 insertions(+), 625 deletions(-) -- 1.9.3