qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC 00/15] Refactor PC machine to take advantage of QOM


From: Anthony Liguori
Subject: [Qemu-devel] [RFC 00/15] Refactor PC machine to take advantage of QOM
Date: Thu, 26 Jan 2012 13:00:45 -0600

Since I plan to commit a good chunk of QOM tomorrow, I wanted to share some more
forward looking work that really starts to take advantage of the new features 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) Most of the chipset features of the piix3 are modelled through composition

 4) i440fx_init is trivialized to creating devices and setting properties

The last point (4) 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.

This series applies on top of my qom-rebase branch.  It's not even close to
ready for inclusion.  I've made no attempt to keep isapc working here.

We need to modeled MemoryRegions and qemu_irq in QOM too.  MemoryRegions
shouldn't be that difficult.  Our habit of passing qemu_irq's as arrays without
an explicit size will probably require some refactoring but in principle,
supporting irqs should be easy too.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]