From patchwork Fri Nov 19 02:56:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 72191 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8DD15B7144 for ; Fri, 19 Nov 2010 14:04:43 +1100 (EST) Received: from localhost ([127.0.0.1]:49279 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJHHE-0008Qs-Dz for incoming@patchwork.ozlabs.org; Thu, 18 Nov 2010 22:04:40 -0500 Received: from [140.186.70.92] (port=45084 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJH9m-0004Pz-HW for qemu-devel@nongnu.org; Thu, 18 Nov 2010 21:57:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJH9k-0004cT-DD for qemu-devel@nongnu.org; Thu, 18 Nov 2010 21:56:58 -0500 Received: from cantor.suse.de ([195.135.220.2]:40720 helo=mx1.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJH9k-0004c1-5z for qemu-devel@nongnu.org; Thu, 18 Nov 2010 21:56:56 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 130DB94033; Fri, 19 Nov 2010 03:56:55 +0100 (CET) From: Alexander Graf To: QEMU-devel Developers Date: Fri, 19 Nov 2010 03:56:53 +0100 Message-Id: <1290135413-21462-12-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1290135413-21462-1-git-send-email-agraf@suse.de> References: <1290135413-21462-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: Kevin Wolf , Joerg Roedel , Gerd Hoffmann , Stefan Hajnoczi , tj@kernel.org, Roland Elek , Sebastian Herbszt Subject: [Qemu-devel] [PATCH 11/11] ahci: spawn controller on demand X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org When we add a device using -drive to the guest, we also need to create a new SATA bus to handle the device. This patch adds a function call that every machine that likes to have IF_SATA support can call to get full device creation by keeping the actual qdev code clean. Signed-off-by: Alexander Graf --- v2 -> v3: - redesign --- hw/pc.h | 1 + hw/pc_piix.c | 3 +++ 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/hw/pc.h b/hw/pc.h index 63b0249..02f452e 100644 --- a/hw/pc.h +++ b/hw/pc.h @@ -108,6 +108,7 @@ void pc_cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size, BusState *ide0, BusState *ide1, FDCtrl *floppy_controller, ISADevice *s); void pc_pci_device_init(PCIBus *pci_bus); +void ahci_create_default_devs(void *pci_bus); typedef void (*cpu_set_smm_t)(int smm, void *arg); void cpu_smm_register(cpu_set_smm_t callback, void *arg); diff --git a/hw/pc_piix.c b/hw/pc_piix.c index 12359a7..1ce880d 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -182,6 +182,9 @@ static void pc_init1(ram_addr_t ram_size, if (pci_enabled) { pc_pci_device_init(pci_bus); +#ifdef CONFIG_AHCI + ahci_create_default_devs(pci_bus); +#endif } }