Skip to content

pc: Don't use QEMUMachine, simplify compat+init code

Eduardo Habkost qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10pc: Define MACHINE_OPTIONS macros consistently for all machineshw/i386/pc_piix.c hw/i386/pc_q35.c+110 -520 replies
2/10pc: Define machines using a DEFINE_PC_MACHINE macrohw/i386/pc_piix.c hw/i386/pc_q35.c include/hw/i386/pc.h+103 -3010 replies
3/10pc: Convert *_MACHINE_OPTIONS macros into functionshw/i386/pc_piix.c hw/i386/pc_q35.c include/hw/i386/pc.h+222 -1510 replies
4/10pc: Move compat_props setting inside *_machine_options() functionshw/i386/pc_piix.c hw/i386/pc_q35.c include/hw/i386/pc.h+65 -360 replies
5/10pc: Don't use QEMUMachine anymorehw/i386/pc_piix.c hw/i386/pc_q35.c include/hw/i386/pc.h+47 -390 replies
6/10pc: Remove qemu_register_pc_machine() functionhw/i386/pc.c include/hw/i386/pc.h+0 -470 replies
7/10machine: Remove unused fields from QEMUMachineinclude/hw/boards.h vl.c+1 -290 replies
8/10piix: Add kvmclock_enabled, pci_enabled globalshw/i386/pc_piix.c+15 -70 replies
9/10piix: Eliminate pc_init_pci()hw/i386/pc_piix.c+13 -180 replies
10/10pc: Generate init functions with a macrohw/i386/pc_piix.c hw/i386/pc_q35.c+76 -1700 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 00/10] pc: Don't use QEMUMachine, simplify compat+init code

This series changes the PC code to not need QEMUMachine anymore, removes ~200 lines of code and simplifies the steps needed to new PC machines in the future.

Previously, a new PC machine required:
* A new PC_COMPAT_* macro;
* A new pc_compat_*() function[1];
* A new pc_init_*() function;
* A new MACHINE_OPTIONS macro;
* A new QEMUMachine declaration;
* A new qemu_register_pc_machine() call in the machine_init() function.

Now it just needs:
* A new PC_COMPAT_* macro;
* A new pc_compat_*() function[1];
* A new pc_*_machine_options() function;
* A DEFINE_*_MACHINE line.

This series depends on the series I submitted recently:
[PATCH v2 00/13] pc, hw, spapr: Cleanup of {HW, PC, SPAPR}_COMPAT_* macros

A git tree can be seen at:
git://github.com/ehabkost/qemu-hacks.git work/pc-compat-macros

[1] I still plan to eliminate the need for the pc_compat_*() functions, and move all compat data inside MachineClass/PCMachineClass, but that will be done later.

Eduardo Habkost (10):
pc: Define MACHINE_OPTIONS macros consistently for all machines
pc: Define machines using a DEFINE_PC_MACHINE macro
pc: Convert *_MACHINE_OPTIONS macros into functions
pc: Move compat_props setting inside *_machine_options() functions
pc: Don't use QEMUMachine anymore
pc: Remove qemu_register_pc_machine() function
machine: Remove unused fields from QEMUMachine
piix: Add kvmclock_enabled, pci_enabled globals
piix: Eliminate pc_init_pci()
pc: Generate init functions with a macro

 hw/i386/pc.c         |  45 -----
 hw/i386/pc_piix.c    | 554 +++++++++++++++++++++------------------------------
 hw/i386/pc_q35.c     | 240 ++++++++--------------
 include/hw/boards.h  |  15 +-
 include/hw/i386/pc.h |  45 ++++-
 vl.c                 |  15 --
 6 files changed, 358 insertions(+), 556 deletions(-)
Signature · 1 line
2.1.0