From patchwork Thu Nov 25 07:07:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 73005 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 D6447B70AA for ; Thu, 25 Nov 2010 18:32:50 +1100 (EST) Received: from localhost ([127.0.0.1]:38191 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PLWJx-0005gq-Ut for incoming@patchwork.ozlabs.org; Thu, 25 Nov 2010 02:32:46 -0500 Received: from [140.186.70.92] (port=43191 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PLVvo-0005bW-B8 for qemu-devel@nongnu.org; Thu, 25 Nov 2010 02:07:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PLVvm-0003Xm-Rk for qemu-devel@nongnu.org; Thu, 25 Nov 2010 02:07:48 -0500 Received: from cantor.suse.de ([195.135.220.2]:38697 helo=mx1.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PLVvm-0003WT-Cw for qemu-devel@nongnu.org; Thu, 25 Nov 2010 02:07:46 -0500 Received: from relay2.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 AC948945D6; Thu, 25 Nov 2010 08:07:43 +0100 (CET) From: Alexander Graf To: QEMU-devel Developers Date: Thu, 25 Nov 2010 08:07:40 +0100 Message-Id: <1290668862-11695-10-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1290668862-11695-1-git-send-email-agraf@suse.de> References: <1290668862-11695-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 , Blue Swirl , Gerd Hoffmann , Stefan Hajnoczi , tj@kernel.org, Roland Elek , Sebastian Herbszt Subject: [Qemu-devel] [PATCH 09/11] ahci: add -drive support 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 We need to be able to spawn new AHCI drives, so let's add AHCI support to the -drive option. Signed-off-by: Alexander Graf --- blockdev.c | 6 +++++- blockdev.h | 1 + qemu-common.h | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 6cb179a..5ce90cc 100644 --- a/blockdev.c +++ b/blockdev.c @@ -209,6 +209,9 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi, int *fatal_error) } else if (!strcmp(buf, "xen")) { type = IF_XEN; max_devs = 0; + } else if (!strcmp(buf, "sata")) { + type = IF_SATA; + max_devs = MAX_SATA_DEVS; } else if (!strcmp(buf, "none")) { type = IF_NONE; max_devs = 0; @@ -402,7 +405,7 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi, int *fatal_error) } else { /* no id supplied -> create one */ dinfo->id = qemu_mallocz(32); - if (type == IF_IDE || type == IF_SCSI) + if (type == IF_IDE || type == IF_SCSI || type == IF_SATA) mediastr = (media == MEDIA_CDROM) ? "-cd" : "-hd"; if (max_devs) snprintf(dinfo->id, 32, "%s%i%s%i", @@ -427,6 +430,7 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi, int *fatal_error) case IF_IDE: case IF_SCSI: case IF_XEN: + case IF_SATA: case IF_NONE: switch(media) { case MEDIA_DISK: diff --git a/blockdev.h b/blockdev.h index 653affc..f50a15e 100644 --- a/blockdev.h +++ b/blockdev.h @@ -33,6 +33,7 @@ struct DriveInfo { #define MAX_IDE_DEVS 2 #define MAX_SCSI_DEVS 7 +#define MAX_SATA_DEVS 4 DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit); int drive_get_max_bus(BlockInterfaceType type); diff --git a/qemu-common.h b/qemu-common.h index b3957f1..ae1cfca 100644 --- a/qemu-common.h +++ b/qemu-common.h @@ -257,7 +257,7 @@ typedef uint64_t pcibus_t; typedef enum { IF_NONE, IF_IDE, IF_SCSI, IF_FLOPPY, IF_PFLASH, IF_MTD, IF_SD, IF_VIRTIO, IF_XEN, - IF_COUNT + IF_SATA, IF_COUNT } BlockInterfaceType; void cpu_exec_init_all(unsigned long tb_size);