From patchwork Tue Nov 23 14:34:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 72685 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 A9A05B70A7 for ; Wed, 24 Nov 2010 02:21:21 +1100 (EST) Received: from localhost ([127.0.0.1]:58032 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PKugI-0006k7-QH for incoming@patchwork.ozlabs.org; Tue, 23 Nov 2010 10:21:18 -0500 Received: from [140.186.70.92] (port=44100 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PKtxQ-00009d-N1 for qemu-devel@nongnu.org; Tue, 23 Nov 2010 09:34:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PKtxL-00072S-Oj for qemu-devel@nongnu.org; Tue, 23 Nov 2010 09:34:56 -0500 Received: from cantor2.suse.de ([195.135.220.15]:49364 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PKtxL-00072A-KA for qemu-devel@nongnu.org; Tue, 23 Nov 2010 09:34:51 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id E19CA89471; Tue, 23 Nov 2010 15:34:49 +0100 (CET) From: Alexander Graf To: QEMU-devel Developers Date: Tue, 23 Nov 2010 15:34:48 +0100 Message-Id: <1290522889-27559-12-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1290522889-27559-1-git-send-email-agraf@suse.de> References: <1290522889-27559-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/12] 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 2be25a6..32edf20 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -183,6 +183,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 } }