From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45109 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJH9n-0004Q3-PN for qemu-devel@nongnu.org; Thu, 18 Nov 2010 21:57:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJH9k-0004d1-H8 for qemu-devel@nongnu.org; Thu, 18 Nov 2010 21:56:59 -0500 Received: from cantor.suse.de ([195.135.220.2]:40716 helo=mx1.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJH9k-0004bi-65 for qemu-devel@nongnu.org; Thu, 18 Nov 2010 21:56:56 -0500 From: Alexander Graf Date: Fri, 19 Nov 2010 03:56:51 +0100 Message-Id: <1290135413-21462-10-git-send-email-agraf@suse.de> In-Reply-To: <1290135413-21462-1-git-send-email-agraf@suse.de> References: <1290135413-21462-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH 09/11] ahci: add -drive support List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU-devel Developers Cc: Kevin Wolf , Joerg Roedel , Gerd Hoffmann , Stefan Hajnoczi , tj@kernel.org, Roland Elek , Sebastian Herbszt 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); -- 1.6.0.2