Skip to content

Convert PC machine-types to QOM classes

Eduardo Habkost qemu-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest33 patches 9 repliesIn review
  2. v3 RFC35 patches 0 repliesSuperseded
  3. v2 RFC39 patches 6 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch2 repliesSuperseded

Changes in v4 from the cover letter

* Include CPU feature properties, so compat_props may be used for CPUID compat bits.
* Move KVM defaults to PCMachineClass.
* Use GList for compat_props instead of reusing GlobalProperty.next (we need to do that to allow the same GlobalProperty to be used on multiple subclasses).
* Finally eliminate all pc_compat_*() functions, and don't require a different init function for each PC machine-type version.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/33pc: Replace tabs with spaces on pc.hinclude/hw/i386/pc.h+6 -60 replies
2/33vl.c: Use qdev_prop_register_global() for single globalsvl.c+15 -240 replies
3/33pc: Eliminate has_pci_info global variablehw/i386/pc_piix.c hw/i386/pc_q35.c+2 -70 replies
4/33piix: Add kvmclock_enabled, pci_enabled globalshw/i386/pc_piix.c+15 -70 replies
5/33piix: Eliminate pc_init_pci()hw/i386/pc_piix.c+10 -150 replies
6/33piix: Move pc-0.14 qxl compat properties to PC_COMPAT_0_14hw/i386/pc_piix.c+8 -90 replies
7/33piix: Move pc-0.13 virtio-9p-pci compat to PC_COMPAT_0_13hw/i386/pc_piix.c+4 -40 replies
8/33piix: Move pc-0.1[23] rombar compat props to PC_COMPAT_0_13hw/i386/pc_piix.c+8 -180 replies
9/33piix: Move pc-0.11 drive version compat props to PC_COMPAT_0_11hw/i386/pc_piix.c+8 -90 replies
10/33machine: Make compat_props a linked listhw/core/machine.c hw/core/qdev-properties.c hw/i386/pc.c +3 more+50 -160 replies
11/33pc: Register machine classes directly instead of using QEMUMachinehw/i386/pc.c hw/i386/pc_piix.c hw/i386/pc_q35.c +1 more+448 -2570 replies
12/33pc: Eliminate pc_common_machine_options()hw/i386/pc.c hw/i386/pc_piix.c include/hw/i386/pc.h+1 -80 replies
13/33pc: Eliminate pc_default_machine_options()hw/i386/pc.c hw/i386/pc_piix.c hw/i386/pc_q35.c +1 more+3 -80 replies
14/33piix: Eliminate pc_i440fx_machine_options()hw/i386/pc_piix.c+29 -260 replies
15/33q35: Eliminate pc_q35_machine_options()hw/i386/pc_q35.c+18 -160 replies
16/33q35: Eliminate pc_q35_1_4_machine_options()hw/i386/pc_q35.c+1 -60 replies
17/33pc: Eliminate all *_machine_options() functionshw/i386/pc_piix.c hw/i386/pc_q35.c include/hw/i386/pc.h+30 -670 replies
18/33machine: Eliminate QEMUMachine.compat_propsinclude/hw/boards.h vl.c+0 -40 replies
19/33pc: Rename pc_machine variable to pcmshw/i386/pc_piix.c hw/i386/pc_q35.c+10 -100 replies
20/33pc: Pass PCMachineState argument to pc_cpus_init()hw/i386/pc.c hw/i386/pc_piix.c hw/i386/pc_q35.c +1 more+10 -90 replies
21/33machine: Add MachineClass.default_cpu_model fieldhw/i386/pc.c hw/i386/pc_piix.c include/hw/boards.h +1 more+11 -110 replies
22/33pc: Move globals to PCMachineClasshw/i386/pc.c hw/i386/pc_piix.c hw/i386/pc_q35.c +1 more+78 -750 replies
23/33pc: Move option_rom_has_mr/rom_file_has_mr to MachineClasshw/core/loader.c hw/core/machine.c hw/i386/pc_piix.c +2 more+16 -110 replies
24/33pc: Add PCMachineClass.compat_apic_id_mode fieldhw/i386/pc_piix.c include/hw/i386/pc.h+8 -20 replies
25/33target-i386: Move error handling to end of x86_cpu_parse_featurestr()target-i386/cpu.c+6 -20 replies
26/33target-i386: Renove underscores from feature namestarget-i386/cpu.c+12 -132 replies
27/33target-i386: Register X86CPU "feat-kvmclock" featuretarget-i386/cpu.c+61 -03 replies
28/33target-i386: set [+-]feature using QOM propertiestarget-i386/cpu.c+65 -940 replies
29/33pc: Use compat_props for CPUID compat bitshw/i386/pc_piix.c hw/i386/pc_q35.c include/hw/i386/pc.h +2 more+8 -330 replies
30/33target-i386: Move some declarations to hw/i386/cpu.hinclude/hw/i386/cpu.h target-i386/cpu.h+566 -5580 replies
31/33pc: Add default KVM features fields to PCMachineClasshw/i386/pc.c hw/i386/pc_piix.c hw/i386/pc_q35.c +3 more+36 -182 replies
32/33pc: Eliminate pc_compat_*() functionshw/i386/pc_piix.c hw/i386/pc_q35.c+3 -1660 replies
33/33piix: Move pc_xen_hvm_init() closer to xenfv_machine_class_init()hw/i386/pc_piix.c+12 -142 replies

Reviews trailers per patch

2 of 33 patches have a Reviewed-by or Acked-by.

PatchAndreas Färber
1/33
2/33R-b
3/33
4/33
5/33
6/33
7/33
8/33
9/33
10/33
11/33
12/33R-b
13/33
14/33
15/33
16/33
17/33
18/33
19/33
20/33
21/33
22/33
23/33
24/33
25/33
26/33
27/33
28/33
29/33
30/33
31/33
32/33
33/33

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [Qemu-devel] [PATCH v4 00/33] Convert PC machine-types to QOM classes

Now all the PC machine-types are declared using only a class_init + TypeInfo pair, and nothing else. In order to do that, all the code that was in the old pc_compat_*() functions are represented using PCMachineClass fields.

Git tree:
https://github.com/ehabkost/qemu-hacks/tree/pc-machine-class.v4

Changes v3 -> v4:
* Include CPU feature properties, so compat_props may be used for CPUID compat bits.
* Move KVM defaults to PCMachineClass.
* Use GList for compat_props instead of reusing GlobalProperty.next (we need to do that to allow the same GlobalProperty to be used on multiple subclasses).
* Finally eliminate all pc_compat_*() functions, and don't require a different init function for each PC machine-type version.

Eduardo Habkost (32):
pc: Replace tabs with spaces on pc.h
vl.c: Use qdev_prop_register_global() for single globals
pc: Eliminate has_pci_info global variable
piix: Add kvmclock_enabled, pci_enabled globals
piix: Eliminate pc_init_pci()
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: Pass PCMachineState argument to pc_cpus_init()
machine: Add MachineClass.default_cpu_model field
pc: Move globals to PCMachineClass
pc: Move option_rom_has_mr/rom_file_has_mr to MachineClass
pc: Add PCMachineClass.compat_apic_id_mode field
target-i386: Move error handling to end of x86_cpu_parse_featurestr()
target-i386: Renove underscores from feature names
target-i386: Register X86CPU "feat-kvmclock" feature
pc: Use compat_props for CPUID compat bits
target-i386: Move some declarations to hw/i386/cpu.h
pc: Add default KVM features fields to PCMachineClass
pc: Eliminate pc_compat_*() functions
piix: Move pc_xen_hvm_init() closer to xenfv_machine_class_init()

Igor Mammedov (1):
target-i386: set [+-]feature using QOM properties

 hw/core/loader.c             |  12 +-
 hw/core/machine.c            |  26 ++
 hw/core/qdev-properties.c    |   9 -
 hw/i386/pc.c                 |  86 ++---
 hw/i386/pc_piix.c            | 764 ++++++++++++++++++++++---------------------
 hw/i386/pc_q35.c             | 271 +++++++--------
 include/hw/boards.h          |  25 +-
 include/hw/i386/cpu.h        | 564 ++++++++++++++++++++++++++++++++
 include/hw/i386/pc.h         |  51 +--
 include/hw/qdev-properties.h |   1 -
 target-i386/cpu.c            | 300 ++++++++---------
 target-i386/cpu.h            | 565 +-------------------------------
 vl.c                         |  47 +--
 13 files changed, 1378 insertions(+), 1343 deletions(-)
 create mode 100644 include/hw/i386/cpu.h
Signature · 1 line
1.9.3