qemu-e2k/hw/i386
Eduardo Habkost b6b5c8e492 pc: Define MACHINE_OPTIONS macros consistently for all machines
Define a MACHINE_OPTIONS macro for each PC machine, and move every field
inside the QEMUMachine structs to the macros, except for name, init, and
compat_props.

This also ensures that all MACHINE_OPTIONS inherit the fields from the
next version, so their definitions carry only the changes that exist
between one version and the next one.

Comments about specific cases:

pc-*-2.1:

  Existing PC_*_2_1_MACHINE_OPTIONS macros were defined as:
      PC_*_MACHINE_OPTIONS,
      .default_machine_opts = "firmware=bios-256k.bin"

  PC_*_2_2_MACHINE_OPTIONS is:
      PC_*_2_3_MACHINE_OPTIONS
  which is expanded to:
      PC_*_MACHINE_OPTIONS,
      .default_machine_opts = "firmware=bios-256k.bin",
      .default_display = "std"

  The only difference between 2_1 and 2_2 is .default_display, that's why
  we didn't reuse PC_*_2_2_MACHINE_OPTIONS. The good news is that having
  multiple initializers for a field is allowed by C99, and the last
  initializer overrides the previous ones.

  So we can reuse the 2_2 macro in 2_1 and define PC_*_2_1_MACHINE_OPTIONS
  as:
      PC_*_2_2_MACHINE_OPTIONS,
      .default_display = NULL

pc-*-1.7:

  PC_*_1_7_MACHINE_OPTIONS was defined as:
      PC_*_MACHINE_OPTIONS

  PC_*_2_0_MACHINE_OPTIONS is defined as:
      PC_*_2_1_MACHINE_OPTIONS
  which is expanded to:
      PC_*_2_2_MACHINE_OPTIONS,
      .default_display = NULL
  which is expanded to:
      PC_*_2_3_MACHINE_OPTIONS,
      .default_display = NULL
  which is expanded to:
      PC_*_MACHINE_OPTIONS,
      .default_machine_opts = "firmware=bios-256k.bin",
      .default_display = "std",
      .default_display = NULL  /* overrides the previous line */

  So, the only difference between PC_*_1_7_MACHINE_OPTIONS and
  PC_*_2_0_MACHINE_OPTIONS is .default_machine_opts (as .default_display
  is not explicitly set by PC_*_MACHINE_OPTIONS so it is NULL).

  So we can keep the macro reuse pattern and define
  PC_*_2_0_MACHINE_OPTIONS as:
      PC_*_2_0_MACHINE_OPTIONS,
      .default_machine_opts = NULL

pc-*-2.4 (alias and is_default fields):

  Set alias and is_default fields inside the 2.4 MACHINE_OPTIONS macro,
  and clear it in the 2.3 macro (that reuses the 2.4 macro).

hw_machine:

  As all the machines older than v1.0 set hw_version explicitly, we can
  safely move the field to the MACHINE_OPTIONS macros without affecting
  the other versions that reuse them.

init function:

  Some machines had the init function set inside the MACHINE_OPTIONS
  macro. Move it to the QEMUMachine declaration, to keep it consistent
  with the other machines.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-05-31 16:26:42 +02:00
..
kvm pci-assign: Convert to realize 2015-02-26 12:42:17 +01:00
xen hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
Makefile.objs pc: acpi-build: drop template patching and create PCI bus tree dynamically 2015-03-01 12:33:23 +01:00
acpi-build.c hw/arm/virt-acpi-build: Generate RSDT table 2015-05-29 11:28:56 +01:00
acpi-build.h i386: ACPI table generation code from seabios 2013-10-14 17:48:57 +03:00
acpi-dsdt-cpu-hotplug.dsl pc: acpi-build: create CPU hotplug IO region dynamically 2015-02-26 13:04:17 +01:00
acpi-dsdt-dbug.dsl i386: add ACPI table files from seabios 2013-10-14 17:48:51 +03:00
acpi-dsdt-hpet.dsl ACPI: Remove commented-out code from HPET._CRS 2014-02-10 11:09:33 +02:00
acpi-dsdt-isa.dsl pc: acpi-build: drop template patching and create Device(SMC) dynamically 2015-03-01 12:33:22 +01:00
acpi-dsdt-mem-hotplug.dsl acpi: add hardware implementation for memory hot unplug 2015-04-27 21:09:07 +02:00
acpi-dsdt.dsl pc: acpi-build: drop template patching and create Device(SMC) dynamically 2015-03-01 12:33:22 +01:00
acpi-dsdt.hex.generated acpi: update generated files 2015-03-04 16:05:32 +01:00
intel_iommu.c Switch non-CPU callers from ld/st*_phys to address_space_ld/st* 2015-04-26 16:49:24 +01:00
intel_iommu_internal.h intel-iommu: add IOTLB using hash table 2014-08-28 23:10:22 +02:00
kvmvapic.c kvmvapic: patch_instruction fix 2014-10-31 11:29:02 +01:00
multiboot.c multiboot: Fix offset of bootloader name 2015-01-26 12:22:44 +01:00
multiboot.h refer to FWCfgState explicitly 2013-06-02 18:14:02 +03:00
pc.c acpi, mem-hotplug: add unplug cb for memory device 2015-04-27 21:07:39 +02:00
pc_piix.c pc: Define MACHINE_OPTIONS macros consistently for all machines 2015-05-31 16:26:42 +02:00
pc_q35.c pc: Define MACHINE_OPTIONS macros consistently for all machines 2015-05-31 16:26:42 +02:00
pc_sysfw.c x86: Drop superfluous conditionals around g_free() 2014-12-15 12:21:02 +01:00
q35-acpi-dsdt.dsl pc: acpi-build: drop template patching and create Device(SMC) dynamically 2015-03-01 12:33:22 +01:00
q35-acpi-dsdt.hex.generated acpi: update generated files 2015-03-04 16:05:32 +01:00
smbios.c smbios: add max speed comdline option for type-17 (meory device) structure 2015-03-19 11:18:51 +03:00
ssdt-tpm.dsl Add ACPI tables for TPM 2014-08-25 00:16:06 +02:00
ssdt-tpm.hex.generated acpi: update generated files 2015-03-02 16:14:33 +01:00