From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrUAg-0005Tc-Fg for qemu-devel@nongnu.org; Wed, 18 Jul 2012 09:20:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SrUAA-0007A4-3S for qemu-devel@nongnu.org; Wed, 18 Jul 2012 09:20:04 -0400 Received: from e23smtp06.au.ibm.com ([202.81.31.148]:56177) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrUA9-00079i-Gw for qemu-devel@nongnu.org; Wed, 18 Jul 2012 09:19:34 -0400 Received: from /spool/local by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 18 Jul 2012 13:12:38 +1000 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6IDBDBE5701654 for ; Wed, 18 Jul 2012 23:11:13 +1000 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6IDJC1e015240 for ; Wed, 18 Jul 2012 23:19:13 +1000 From: Wanpeng Li Date: Wed, 18 Jul 2012 21:19:00 +0800 Message-Id: <1342617545-9261-1-git-send-email-liwanp@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v4 0/5] refactor PC machine, i440fx and piix3 to take advantage of QOM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Ram Pai , Gavin Shan , "Michael S. Tsirkin" , Jan Kiszka , qemu-devel@nongnu.org, Liu Ping Fan , Blue Swirl , Stefan Weil , Avi Kivity , Paolo Bonzini , Wanpeng Li [CCing ML] 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 5) convert MemoryRegion to QOM 6) convert PCI host bridge to QOM The 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. Signed-off-by: Anthony Liguori Signed-off-by: Wanpeng Li Change 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 (5): eliminate piix_pci.c and module i440fx and piix3 convert MemoryRegion to QOM convert pci-host to QOM prepare to create HPET, RTC and i8254 through composition merge pc_piix.c to pc.c hw/hpet.c | 39 +--- hw/hpet_emul.h | 41 +++ hw/i386/Makefile.objs | 3 +- hw/i440fx.c | 434 +++++++++++++++++++++++++++++ hw/i440fx.h | 77 +++++ hw/i8254.c | 2 +- hw/i8254_internal.h | 2 +- hw/mc146818rtc.c | 26 -- hw/mc146818rtc.h | 30 ++ hw/pc.c | 741 +++++++++++++++++++++++++++++++++++++++++++------ hw/pc.h | 46 +--- hw/pc_piix.c | 661 ------------------------------------------- hw/pci_host.c | 26 ++ hw/pci_host.h | 5 + hw/piix3.c | 292 +++++++++++++++++++ hw/piix3.h | 79 ++++++ hw/piix_pci.c | 599 --------------------------------------- memory.c | 94 +++++-- memory.h | 8 + 19 files changed, 1722 insertions(+), 1483 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 -- 1.7.5.4