From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCDgB-0001Pr-Lr for qemu-devel@nongnu.org; Mon, 26 Mar 2012 13:26:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCDg5-0000SG-Cl for qemu-devel@nongnu.org; Mon, 26 Mar 2012 13:26:03 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:42775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCDg5-0000Rq-2E for qemu-devel@nongnu.org; Mon, 26 Mar 2012 13:25:57 -0400 Received: by obbwd20 with SMTP id wd20so6255675obb.4 for ; Mon, 26 Mar 2012 10:25:55 -0700 (PDT) Message-ID: <4F70A6A0.5030603@codemonkey.ws> Date: Mon, 26 Mar 2012 12:25:52 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1332727608-26523-1-git-send-email-liwp@linux.vnet.ibm.com> In-Reply-To: <1332727608-26523-1-git-send-email-liwp@linux.vnet.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/6] refactor PC machine, i440fx and piix3 to take advantage of QOM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wanpeng Li Cc: Gavin Shan , Anthony Liguori , qemu-devel@nongnu.org, Avi Kivity On 03/25/2012 09:06 PM, Wanpeng Li wrote: > From: Anthony Liguori > > > 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 I should add that there's a short term focus on refactoring the i440fx in such a way that we can introduce a new chipset (Q35). Regards, Anthony Liguori > > --- > Makefile.target | 3 +- > hw/hpet.c | 39 +--- > hw/hpet_emul.h | 41 +++ > hw/i440fx.c | 431 ++++++++++++++++++++++++++ > hw/i440fx.h | 78 +++++ > hw/i8254_internal.h | 2 +- > hw/mc146818rtc.c | 26 -- > hw/mc146818rtc.h | 29 ++ > hw/pc.c | 838 +++++++++++++++++++++++++++++++++++++++++++++------ > hw/pc.h | 46 +--- > hw/pc_piix.c | 762 ---------------------------------------------- > hw/pci_host.c | 26 ++ > hw/pci_host.h | 5 + > hw/piix3.c | 274 +++++++++++++++++ > hw/piix3.h | 79 +++++ > hw/piix_pci.c | 600 ------------------------------------ > memory.c | 94 +++++-- > memory.h | 8 + > 18 files changed, 1795 insertions(+), 1586 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 > -- > >