Skip to content

refactor PC machine, i440fx and piix3 to take advantage of QOM

Wanpeng Li qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest posting 2/23 patches 2 repliesIn review
  2. v5 posting 1/23 patches 2 repliesSuperseded
  3. v45 patches 9 repliesSuperseded

Changes in v5 from the cover letter

* fix bisect issues
* take advantage of Andreas's pci_host patchset
* drop convert MemoryRegion to QOM
* drop prepare to create HPET, RTC and i8254 through composition

Patches in v5 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3eliminate piix_pci.c and module i440fx and piix3hw/i386/Makefile.objs hw/i440fx.c hw/i440fx.h +6 more+882 -6940 replies
2/3merge pc_piix.c to pc.chw/i386/Makefile.objs hw/pc.c hw/pc.h +1 more+706 -7720 replies
3/3convert pci-host to QOMhw/pci_host.c+9 -01 reply

Reviews trailers per patch

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

Read the v5 thread

Cover letter [Qemu-devel] [PATCH v5 0/3] refactor PC machine, i440fx and piix3 to take advantage of QOM

This series aggressively refactors the PC machine initialization to be more modelled and less ad-hoc. The highlights of this series are:

1) Things like -m and -bios-name are now device model properties

2) The i440fx and piix3 are now modelled in a thorough fashion

3) i440fx_init is trivialized to creating devices and setting properties

4) convert PCI host bridge to QOM

The point (3) is the most important one. As we refactor in this fashion, we should quickly get to the point where machine->init disappears completely in favor of just creating a handful of devices.

The two stage initialization of QOM is important here. instance_init() is when composed devices are created which means that after you've created a device, all of its children are visible in the device model. This lets you set properties of the parent and its children.

realize() (which is still called DeviceState::init today) will be called right before the guest starts up for the first time.

Changes in v5:
* fix bisect issues
* take advantage of Andreas's pci_host patchset
* drop convert MemoryRegion to QOM
* drop prepare to create HPET, RTC and i8254 through composition

Changes in v4:

*rebase patchset

Changes in v3:

* fix coding style issues
* fix rebase error
* add changes log

Changes in v2:

* Rebase patch series of i440fx in Anthony's qom-rebase.12 branch to upstream
* convert MemoryRegion to QOM
* convert pci_host to QOM

Anthony Liguori (3):
eliminate piix_pci.c and module i440fx and piix3 merge pc_piix.c to pc.c
convert pci-host to QOM

 hw/i386/Makefile.objs |    3 +-
 hw/i440fx.c           |  434 ++++++++++++++++++++++++++++
 hw/i440fx.h           |   76 +++++
 hw/pc.c               |  753 ++++++++++++++++++++++++++++++++++++++++++++++---
 hw/pc.h               |   41 +---
 hw/pc_piix.c          |  716 ----------------------------------------------
 hw/pci_host.c         |    9 +
 hw/piix3.c            |  258 +++++++++++++++++
 hw/piix3.h            |   73 +++++
 hw/piix_pci.c         |  622 ----------------------------------------
 10 files changed, 1558 insertions(+), 1427 deletions(-)
 create mode 100644 hw/i440fx.c
 create mode 100644 hw/i440fx.h
 delete mode 100644 hw/pc_piix.c
 create mode 100644 hw/piix3.c
 create mode 100644 hw/piix3.h
 delete mode 100644 hw/piix_pci.c
Signature · 1 line
1.7.7.6