From patchwork Fri Dec 2 20:20:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 128979 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2DB17B6F69 for ; Sat, 3 Dec 2011 08:09:05 +1100 (EST) Received: from localhost ([::1]:43430 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RWZde-0004mA-KP for incoming@patchwork.ozlabs.org; Fri, 02 Dec 2011 15:23:18 -0500 Received: from eggs.gnu.org ([140.186.70.92]:33023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RWZdM-0003NY-2B for qemu-devel@nongnu.org; Fri, 02 Dec 2011 15:23:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RWZcW-0007qD-8v for qemu-devel@nongnu.org; Fri, 02 Dec 2011 15:22:19 -0500 Received: from cpe-70-123-132-139.austin.res.rr.com ([70.123.132.139]:49999 helo=localhost6.localdomain6) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RWZcV-0007q6-UD for qemu-devel@nongnu.org; Fri, 02 Dec 2011 15:22:08 -0500 Received: from localhost6.localdomain6 (localhost.localdomain [127.0.0.1]) by localhost6.localdomain6 (8.14.4/8.14.4/Debian-2ubuntu1) with ESMTP id pB2KLqeS015075; Fri, 2 Dec 2011 14:21:52 -0600 Received: (from anthony@localhost) by localhost6.localdomain6 (8.14.4/8.14.4/Submit) id pB2KLo8v015073; Fri, 2 Dec 2011 14:21:50 -0600 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Fri, 2 Dec 2011 14:20:52 -0600 Message-Id: <1322857256-14951-15-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1322857256-14951-1-git-send-email-aliguori@us.ibm.com> References: <1322857256-14951-1-git-send-email-aliguori@us.ibm.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 70.123.132.139 Cc: Kevin Wolf , Peter Maydell , Anthony Liguori , Stefan Hajnoczi , Jan Kiszka , Markus Armbruster , Luiz Capitulino , Gerd Hoffman Subject: [Qemu-devel] [PATCH v2 14/18] rtc: make piix3 set the rtc as a child (v2) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Anthony Liguori --- v1 -> v2 - comments (Stefan) --- hw/pc_piix.c | 11 +++++++++++ hw/piix_pci.c | 3 +++ 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/hw/pc_piix.c b/hw/pc_piix.c index 970f43c..2d5ea2c 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -205,6 +205,17 @@ static void pc_init1(MemoryRegion *system_memory, } } + /* FIXME there's some major spaghetti here. Somehow we create the devices + * on the PIIX before we actually create it. We create the PIIX3 deep in + * the recess of the i440fx creation too and then lose the DeviceState. + * + * For now, let's "fix" this by making judicious use of paths. This is not + * generally the right way to do this. + */ + + qdev_property_add_child(qdev_resolve_path("/i440fx/piix3", NULL), + "rtc", (DeviceState *)rtc_state, NULL); + audio_init(gsi, pci_enabled ? pci_bus : NULL); pc_cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device, diff --git a/hw/piix_pci.c b/hw/piix_pci.c index d183443..d785d4b 100644 --- a/hw/piix_pci.c +++ b/hw/piix_pci.c @@ -288,6 +288,7 @@ static PCIBus *i440fx_common_init(const char *device_name, address_space_io, 0); s->bus = b; qdev_init_nofail(dev); + qdev_property_add_child(qdev_get_root(), "i440fx", dev, NULL); d = pci_create_simple(b, 0, device_name); *pi440fx_state = DO_UPCAST(PCII440FXState, dev, d); @@ -323,6 +324,8 @@ static PCIBus *i440fx_common_init(const char *device_name, pci_create_simple_multifunction(b, -1, true, "PIIX3")); pci_bus_irqs(b, piix3_set_irq, pci_slot_get_pirq, piix3, PIIX_NUM_PIRQS); + + qdev_property_add_child(dev, "piix3", &piix3->dev.qdev, NULL); } piix3->pic = pic;